Skip to content

Commit

Permalink
fix issue #298 (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
adashen authored Nov 21, 2018
1 parent 52deb6f commit 0a48fcc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "azure-iot-edge",
"displayName": "Azure IoT Edge",
"description": "Develop, deploy, debug, and manage your IoT Edge solution",
"version": "1.6.0-rc2",
"version": "1.6.0-rc3",
"publisher": "vsciot-vscode",
"aiKey": "95b20d64-f54f-4de3-8ad5-165a75a6c6fe",
"icon": "logo.png",
Expand Down
15 changes: 9 additions & 6 deletions src/edge/edgeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,17 +328,20 @@ export class EdgeManager {

const templateDebugFile = path.join(slnPath, Constants.deploymentDebugTemplate);
const debugTemplateEnv = {usernameEnv: undefined, passwordEnv: undefined};
let debugExist = false;
if (await fse.pathExists(templateDebugFile)) {
debugExist = true;
const templateDebugJson = Utility.updateSchema(await fse.readJson(templateDebugFile));
const envs = await this.addModuleToDeploymentTemplate(templateDebugJson, templateDebugFile, envFilePath, moduleInfo, needUpdateRegistry, isNewSolution, true);
debugTemplateEnv.usernameEnv = envs.usernameEnv;
debugTemplateEnv.passwordEnv = envs.passwordEnv;
}

if (!isNewSolution) {
const launchUpdated: string = debugGenerated ? "and 'launch.json' are updated." : "is updated.";
const launchUpdated: string = debugGenerated ? "and 'launch.json' are updated." : "are updated.";
const moduleCreationMessage = template === Constants.EXISTING_MODULE ? "" : `Module '${moduleName}' has been created. `;
vscode.window.showInformationMessage(`${moduleCreationMessage}'deployment.template.json' ${launchUpdated}`);
const deploymentTemlateMessage = debugExist ? "deployment.template.json, deployment.debug.template.json" : "deployment.template.json";
vscode.window.showInformationMessage(`${moduleCreationMessage} ${deploymentTemlateMessage} ${launchUpdated}`);
}
const address = await Utility.getRegistryAddress(moduleInfo.repositoryName);
await this.writeRegistryCredEnv(address, envFilePath, usernameEnv, passwordEnv, debugTemplateEnv.usernameEnv, debugTemplateEnv.passwordEnv);
Expand Down Expand Up @@ -567,18 +570,18 @@ export class EdgeManager {
const thirdPartyModuleTemplate = this.get3rdPartyModuleTemplateByName(template);
if (template === Constants.ACR_MODULE) {
const acrManager = new AcrManager();
imageName = await acrManager.selectAcrImage();
debugImageName = imageName = await acrManager.selectAcrImage();
repositoryName = Utility.getRepositoryNameFromImageName(imageName);
} else if (template === Constants.EXISTING_MODULE) {
imageName = await Utility.showInputBox(Constants.imagePattern, Constants.imagePrompt);
debugImageName = imageName = await Utility.showInputBox(Constants.imagePattern, Constants.imagePrompt);
repositoryName = Utility.getRepositoryNameFromImageName(imageName);
} else if (template === Constants.STREAM_ANALYTICS) {
const saManager = new StreamAnalyticsManager();
const job = await saManager.selectStreamingJob();
const JobInfo: any = await saManager.getJobInfo(job);
imageName = JobInfo.settings.image;
debugImageName = imageName = JobInfo.settings.image;
moduleTwin = JobInfo.twin.content;
createOptions = JobInfo.settings.createOptions ? JobInfo.settings.createOptions : {};
debugCreateOptions = createOptions = JobInfo.settings.createOptions ? JobInfo.settings.createOptions : {};
} else if (thirdPartyModuleTemplate) {
if (thirdPartyModuleTemplate.command && thirdPartyModuleTemplate.command.includes(Constants.repositoryNameSubstitution)) {
repositoryName = await this.inputRepository(module);
Expand Down

0 comments on commit 0a48fcc

Please sign in to comment.