mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Create project within folder (#11037)
This commit is contained in:
@@ -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> {
|
public async createNewProject(newProjName: string, folderUri: Uri, projectGuid?: string): Promise<string> {
|
||||||
if (projectGuid && !UUID.isUUID(projectGuid)) {
|
if (projectGuid && !UUID.isUUID(projectGuid)) {
|
||||||
throw new Error(`Specified GUID is invalid: '${projectGuid}'`);
|
throw new Error(`Specified GUID is invalid: '${projectGuid}'`);
|
||||||
@@ -119,7 +125,7 @@ export class ProjectsController {
|
|||||||
newProjFileName += constants.sqlprojExtension;
|
newProjFileName += constants.sqlprojExtension;
|
||||||
}
|
}
|
||||||
|
|
||||||
const newProjFilePath = path.join(folderUri.fsPath, newProjFileName);
|
const newProjFilePath = path.join(folderUri.fsPath, path.parse(newProjFileName).name, newProjFileName);
|
||||||
|
|
||||||
let fileExists = false;
|
let fileExists = false;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ describe.skip('ProjectsController: project controller operations', function ():
|
|||||||
let profilePath = await testUtils.createTestFile(baselines.publishProfileBaseline, 'publishProfile.publish.xml');
|
let profilePath = await testUtils.createTestFile(baselines.publishProfileBaseline, 'publishProfile.publish.xml');
|
||||||
const projController = new ProjectsController(testContext.apiWrapper.object, new SqlDatabaseProjectTreeViewProvider());
|
const projController = new ProjectsController(testContext.apiWrapper.object, new SqlDatabaseProjectTreeViewProvider());
|
||||||
|
|
||||||
let result = await projController.readPublishProfile(vscode.Uri.parse(profilePath));
|
let result = await projController.readPublishProfile(vscode.Uri.file(profilePath));
|
||||||
should(result.databaseName).equal('targetDb');
|
should(result.databaseName).equal('targetDb');
|
||||||
should(Object.keys(result.sqlCmdVariables).length).equal(1);
|
should(Object.keys(result.sqlCmdVariables).length).equal(1);
|
||||||
should(result.sqlCmdVariables['ProdDatabaseName']).equal('MyProdDatabase');
|
should(result.sqlCmdVariables['ProdDatabaseName']).equal('MyProdDatabase');
|
||||||
|
|||||||
Reference in New Issue
Block a user