Align with the new registerCommand logic (#44)
This commit is contained in:
Родитель
55ad348049
Коммит
3cba890ed8
|
@ -16,7 +16,7 @@ export class ContainerManager {
|
|||
|
||||
public async buildModuleImage(fileUri?: vscode.Uri, pushImage: boolean = false) {
|
||||
const event = pushImage ? Constants.buildAndPushModuleImageEvent : Constants.buildModuleImageEvent;
|
||||
const moduleConfigFilePath: string = await Utility.getInputFilePath(fileUri, Constants.moduleConfigFileNamePattern, Constants.moduleConfigFile, `${event}.start`);
|
||||
const moduleConfigFilePath: string = await Utility.getInputFilePath(fileUri, Constants.moduleConfigFileNamePattern, Constants.moduleConfigFile, `${event}.selectModuleConfigFile`);
|
||||
|
||||
if (moduleConfigFilePath) {
|
||||
const moduleConfig = await Utility.readJsonAndExpandEnv(moduleConfigFilePath, "$schema");
|
||||
|
@ -33,7 +33,6 @@ export class ContainerManager {
|
|||
} else {
|
||||
Executor.runInTerminal(buildCommand);
|
||||
}
|
||||
TelemetryClient.sendEvent(`${event}.end`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,13 +18,17 @@ export function activate(context: vscode.ExtensionContext) {
|
|||
const outputChannel: vscode.OutputChannel = vscode.window.createOutputChannel(Constants.edgeChannel);
|
||||
context.subscriptions.push(outputChannel);
|
||||
|
||||
context.subscriptions.push(vscode.commands.registerCommand("azure-iot-edge.buildModuleImage", (fileUri: vscode.Uri) => {
|
||||
containerManager.buildModuleImage(fileUri, false);
|
||||
}));
|
||||
initCommmandAsync(context, outputChannel,
|
||||
"azure-iot-edge.buildModuleImage",
|
||||
(fileUri?: vscode.Uri): Promise<void> => {
|
||||
return containerManager.buildModuleImage(fileUri, false);
|
||||
});
|
||||
|
||||
context.subscriptions.push(vscode.commands.registerCommand("azure-iot-edge.buildAndPushModuleImage", (fileUri: vscode.Uri) => {
|
||||
containerManager.buildModuleImage(fileUri, true);
|
||||
}));
|
||||
initCommmandAsync(context, outputChannel,
|
||||
"azure-iot-edge.buildAndPushModuleImage",
|
||||
(fileUri?: vscode.Uri): Promise<void> => {
|
||||
return containerManager.buildModuleImage(fileUri, true);
|
||||
});
|
||||
|
||||
initCommmandAsync(context, outputChannel,
|
||||
"azure-iot-edge.newSolution",
|
||||
|
|
Загрузка…
Ссылка в новой задаче