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 {
409
409
taskGroup : vscode . TaskGroup . Build ,
410
410
} ;
411
411
412
- let execPath = main . execRelPath ( ) ;
412
+ let execRelPath = main . execRelPath ( ) ;
413
413
/**
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.
416
424
*/
417
- if ( ! execPath . includes ( path . sep ) ) {
418
- execPath = './' + execPath ;
419
- }
425
+ execRelPath = '.' + path . sep + path . normalize ( execRelPath ) ;
420
426
const runTask : PredefinedTask = {
421
427
label : getRunTaskPlainName ( main ) ,
422
428
taskDef : {
423
429
type : this . taskType ,
424
- command : execPath ,
430
+ command : execRelPath ,
425
431
args : [ ] ,
426
432
} ,
427
433
} ;
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
71
71
ada: Compile current file - gprbuild -q -f -c -u -P ${ projectPath } \${fileBasename} -cargs:ada -gnatef
72
72
ada: Generate documentation from the project - gnatdoc -P ${ projectPath }
73
73
ada: 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 }
75
75
ada: 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 }
77
77
` . trim ( ) ;
78
78
79
79
const prov = createAdaTaskProvider ( ) ;
You can’t perform that action at this time.
0 commit comments