mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-21 01:25:37 -05:00
fix pre/post deploy scripts getting double counted in the files for sdk style projects (#17954)
* fix pre/post deploy scripts getting double counted in the files for sdk style projects * add test * update comment
This commit is contained in:
@@ -122,13 +122,15 @@ export class Project implements ISqlProject {
|
||||
// check if this is an sdk style project https://docs.microsoft.com/en-us/dotnet/core/project-sdk/overview
|
||||
this._isSdkStyleProject = this.CheckForSdkStyleProject();
|
||||
|
||||
// get pre and post deploy scripts specified in the sqlproj
|
||||
this._preDeployScripts = this.readPreDeployScripts();
|
||||
this._postDeployScripts = this.readPostDeployScripts();
|
||||
this._noneDeployScripts = this.readNoneDeployScripts();
|
||||
|
||||
// get files and folders
|
||||
this._files = await this.readFilesInProject();
|
||||
this.files.push(...await this.readFolders());
|
||||
|
||||
this._preDeployScripts = this.readPreDeployScripts();
|
||||
this._postDeployScripts = this.readPostDeployScripts();
|
||||
this._noneDeployScripts = this.readNoneDeployScripts();
|
||||
this._databaseReferences = this.readDatabaseReferences();
|
||||
this._importedTargets = this.readImportedTargets();
|
||||
|
||||
@@ -225,6 +227,13 @@ export class Project implements ISqlProject {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.isSdkStyleProject) {
|
||||
// remove any pre/post/none deploy scripts that were specified in the sqlproj so they aren't counted twice
|
||||
this.preDeployScripts.forEach(f => filesSet.delete(f.relativePath));
|
||||
this.postDeployScripts.forEach(f => filesSet.delete(f.relativePath));
|
||||
this.noneDeployScripts.forEach(f => filesSet.delete(f.relativePath));
|
||||
}
|
||||
|
||||
// create a FileProjectEntry for each file
|
||||
const fileEntries: FileProjectEntry[] = [];
|
||||
filesSet.forEach(f => {
|
||||
|
||||
Reference in New Issue
Block a user