File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -409,19 +409,25 @@ export class SimpleTaskProvider implements vscode.TaskProvider {
409409 taskGroup : vscode . TaskGroup . Build ,
410410 } ;
411411
412- let execPath = main . execRelPath ( ) ;
412+ let execRelPath = main . execRelPath ( ) ;
413413 /**
414- * If the exec is directly at the root of the workspace,
415- * prepend ./ to make it possible for shells to execute it.
414+ * Always prepend ./ to the relative path. When the path
415+ * only has one component, ./ is necessary for the shell to
416+ * spawn the executable. We choose to always prepend ./ for
417+ * consistency.
418+ *
419+ * We can't use path.join() because it calls
420+ * path.normalize() which removes ./
421+ *
422+ * We use path.normalize() to make sure the path uses
423+ * platform-specific separators.
416424 */
417- if ( ! execPath . includes ( path . sep ) ) {
418- execPath = './' + execPath ;
419- }
425+ execRelPath = '.' + path . sep + path . normalize ( execRelPath ) ;
420426 const runTask : PredefinedTask = {
421427 label : getRunTaskPlainName ( main ) ,
422428 taskDef : {
423429 type : this . taskType ,
424- command : execPath ,
430+ command : execRelPath ,
425431 args : [ ] ,
426432 } ,
427433 } ;
Original file line number Diff line number Diff line change @@ -71,9 +71,9 @@ ada: Check current file - gprbuild -q -f -c -u -gnatc -P ${projectPath} \${fileB
7171ada: Compile current file - gprbuild -q -f -c -u -P ${ projectPath } \${fileBasename} -cargs:ada -gnatef
7272ada: Generate documentation from the project - gnatdoc -P ${ projectPath }
7373ada: Build main - src/main1.adb - gprbuild -P ${ projectPath } src/main1.adb -cargs:ada -gnatef
74- ada: Run main - src/main1.adb - obj/ main1exec${ exe }
74+ ada: Run main - src/main1.adb - . ${ path . sep } obj${ path . sep } main1exec${ exe }
7575ada: Build main - src/test.adb - gprbuild -P ${ projectPath } src/test.adb -cargs:ada -gnatef
76- ada: Run main - src/test.adb - obj/ test${ exe }
76+ ada: Run main - src/test.adb - . ${ path . sep } obj${ path . sep } test${ exe }
7777` . trim ( ) ;
7878
7979 const prov = createAdaTaskProvider ( ) ;
You can’t perform that action at this time.
0 commit comments