mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
use fsPath instead of path when calculating relative path to sqlproj (#22534)
This commit is contained in:
@@ -1406,7 +1406,7 @@ export class ProjectsController {
|
|||||||
// 6. add generated files to SQL project
|
// 6. add generated files to SQL project
|
||||||
|
|
||||||
const uriList = scriptList.filter(f => !f.fsPath.endsWith(constants.autorestPostDeploymentScriptName))
|
const uriList = scriptList.filter(f => !f.fsPath.endsWith(constants.autorestPostDeploymentScriptName))
|
||||||
const relativePaths = uriList.map(f => path.relative(project.projectFolderPath, f.path));
|
const relativePaths = uriList.map(f => path.relative(project.projectFolderPath, f.fsPath));
|
||||||
await project.addSqlObjectScripts(relativePaths); // Add generated file structure to the project
|
await project.addSqlObjectScripts(relativePaths); // Add generated file structure to the project
|
||||||
|
|
||||||
const postDeploymentScript: vscode.Uri | undefined = this.findPostDeploymentScript(scriptList);
|
const postDeploymentScript: vscode.Uri | undefined = this.findPostDeploymentScript(scriptList);
|
||||||
@@ -1599,7 +1599,7 @@ export class ProjectsController {
|
|||||||
|
|
||||||
const scriptList: vscode.Uri[] = model.extractTarget === mssql.ExtractTarget.file ? [vscode.Uri.file(model.filePath)] : await this.generateScriptList(model.filePath); // Create a list of all the files to be added to project
|
const scriptList: vscode.Uri[] = model.extractTarget === mssql.ExtractTarget.file ? [vscode.Uri.file(model.filePath)] : await this.generateScriptList(model.filePath); // Create a list of all the files to be added to project
|
||||||
|
|
||||||
const relativePaths = scriptList.map(f => path.relative(project.projectFolderPath, f.path));
|
const relativePaths = scriptList.map(f => path.relative(project.projectFolderPath, f.fsPath));
|
||||||
|
|
||||||
if (!model.sdkStyle) {
|
if (!model.sdkStyle) {
|
||||||
await project.addSqlObjectScripts(relativePaths); // Add generated file structure to the project
|
await project.addSqlObjectScripts(relativePaths); // Add generated file structure to the project
|
||||||
@@ -1839,7 +1839,7 @@ export class ProjectsController {
|
|||||||
|
|
||||||
let toAdd: vscode.Uri[] = [];
|
let toAdd: vscode.Uri[] = [];
|
||||||
result.addedFiles.forEach((f: any) => toAdd.push(vscode.Uri.file(f)));
|
result.addedFiles.forEach((f: any) => toAdd.push(vscode.Uri.file(f)));
|
||||||
const relativePaths = toAdd.map(f => path.relative(project.projectFolderPath, f.path));
|
const relativePaths = toAdd.map(f => path.relative(project.projectFolderPath, f.fsPath));
|
||||||
|
|
||||||
await project.addSqlObjectScripts(relativePaths);
|
await project.addSqlObjectScripts(relativePaths);
|
||||||
|
|
||||||
@@ -1847,7 +1847,7 @@ export class ProjectsController {
|
|||||||
result.deletedFiles.forEach((f: any) => toRemove.push(vscode.Uri.file(f)));
|
result.deletedFiles.forEach((f: any) => toRemove.push(vscode.Uri.file(f)));
|
||||||
|
|
||||||
let toRemoveEntries: FileProjectEntry[] = [];
|
let toRemoveEntries: FileProjectEntry[] = [];
|
||||||
toRemove.forEach(f => toRemoveEntries.push(new FileProjectEntry(f, f.path.replace(projectPath + '\\', ''), EntryType.File)));
|
toRemove.forEach(f => toRemoveEntries.push(new FileProjectEntry(f, f.fsPath.replace(projectPath + '\\', ''), EntryType.File)));
|
||||||
|
|
||||||
toRemoveEntries.forEach(async f => await project.excludeSqlObjectScript(f.fsUri.fsPath));
|
toRemoveEntries.forEach(async f => await project.excludeSqlObjectScript(f.fsUri.fsPath));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user