File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import * as path from 'path';
1010import * as vscode from 'vscode' ;
1111import * as tasks from 'vscode-tasks' ;
1212
13- function promptToAddBuildTask ( ) {
13+ function promptToAddBuildTask ( ) : Promise < boolean > {
1414 return new Promise < boolean > ( ( resolve , reject ) => {
1515 const item = { title : 'Yes' }
1616
@@ -69,17 +69,21 @@ export function promptToAddBuildTaskIfNecessary() {
6969 let buildTask = tasksConfig . tasks . find ( td => td . taskName === 'build' ) ;
7070 if ( ! buildTask ) {
7171 promptToAddBuildTask ( ) . then ( shouldAdd => {
72- buildTask = createBuildTaskDescription ( ) ;
73- tasksConfig . tasks . push ( buildTask ) ;
74- writeTasksJson ( tasksJsonPath , tasksConfig ) ;
72+ if ( shouldAdd ) {
73+ buildTask = createBuildTaskDescription ( ) ;
74+ tasksConfig . tasks . push ( buildTask ) ;
75+ writeTasksJson ( tasksJsonPath , tasksConfig ) ;
76+ }
7577 } ) ;
7678 }
7779 } ) ;
7880 }
7981 else {
8082 promptToAddBuildTask ( ) . then ( shouldAdd => {
81- const tasksConfig = createTasksConfiguration ( ) ;
82- writeTasksJson ( tasksJsonPath , tasksConfig ) ;
83+ if ( shouldAdd ) {
84+ const tasksConfig = createTasksConfiguration ( ) ;
85+ writeTasksJson ( tasksJsonPath , tasksConfig ) ;
86+ }
8387 } ) ;
8488 }
8589 } ) ;
You can’t perform that action at this time.
0 commit comments