Create project within folder (#11037)

This commit is contained in:
Benjin Dubishar
2020-06-22 21:27:16 -07:00
committed by GitHub
parent 98ff618efd
commit d0b71e116b
2 changed files with 8 additions and 2 deletions

View File

@@ -101,6 +101,12 @@ export class ProjectsController {
}
}
/**
* Creates a new folder with the project name in the specified location, and places the new .sqlproj inside it
* @param newProjName
* @param folderUri
* @param projectGuid
*/
public async createNewProject(newProjName: string, folderUri: Uri, projectGuid?: string): Promise<string> {
if (projectGuid && !UUID.isUUID(projectGuid)) {
throw new Error(`Specified GUID is invalid: '${projectGuid}'`);
@@ -119,7 +125,7 @@ export class ProjectsController {
newProjFileName += constants.sqlprojExtension;
}
const newProjFilePath = path.join(folderUri.fsPath, newProjFileName);
const newProjFilePath = path.join(folderUri.fsPath, path.parse(newProjFileName).name, newProjFileName);
let fileExists = false;
try {