Skip to content

Commit 2bff476

Browse files
committed
Add useful error on wrong version
if the version of gomodifytags does not have --template (we try to infer that) let the user know and prompt for update.
1 parent e855d50 commit 2bff476

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/goModifytags.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import cp = require('child_process');
99
import vscode = require('vscode');
1010
import { toolExecutionEnvironment } from './goEnv';
11-
import { promptForMissingTool } from './goInstallTools';
11+
import { promptForMissingTool, promptForUpdatingTool } from './goInstallTools';
1212
import { byteOffsetAt, getBinPath, getFileArchive, getGoConfig } from './util';
1313

1414
// Interface for the output from gomodifytags
@@ -165,6 +165,12 @@ function runGomodifytags(args: string[]) {
165165
promptForMissingTool('gomodifytags');
166166
return;
167167
}
168+
if (err && (<any>err).code === 2 && args.indexOf("--template") > 0) {
169+
vscode.window.showInformationMessage(`Cannot modify tags: you might be using a` +
170+
`version that does not support --template`);
171+
promptForUpdatingTool('gomodifytags');
172+
return;
173+
}
168174
if (err) {
169175
vscode.window.showInformationMessage(`Cannot modify tags: ${stderr}`);
170176
return;

0 commit comments

Comments
 (0)