File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 1- function quoteArg ( arg : string ) : string {
1+ export function quoteArg ( arg : string ) : string {
22 if ( arg . indexOf ( ' ' ) >= 0 && ! ( arg . startsWith ( '"' ) && arg . endsWith ( '"' ) ) ) {
33 return `"${ arg } "` ;
44 }
Original file line number Diff line number Diff line change @@ -8,10 +8,10 @@ import {
88 Uri ,
99 WorkspaceFolder ,
1010} from 'vscode' ;
11- import { PythonTaskExecutionOptions } from '../../api' ;
12- import { getWorkspaceFolder } from '../../common/workspace.apis' ;
13- import { PythonEnvironment } from '../../api' ;
11+ import { PythonEnvironment , PythonTaskExecutionOptions } from '../../api' ;
1412import { executeTask } from '../../common/tasks.apis' ;
13+ import { getWorkspaceFolder } from '../../common/workspace.apis' ;
14+ import { quoteArg } from './execUtils' ;
1515
1616function getWorkspaceFolderOrDefault ( uri ?: Uri ) : WorkspaceFolder | TaskScope {
1717 const workspace = uri ? getWorkspaceFolder ( uri ) : undefined ;
@@ -25,8 +25,8 @@ export async function runAsTask(
2525) : Promise < TaskExecution > {
2626 const workspace : WorkspaceFolder | TaskScope = getWorkspaceFolderOrDefault ( options . project ?. uri ) ;
2727
28- const executable =
29- environment . execInfo ?. activatedRun ?. executable ?? environment . execInfo ?. run . executable ?? 'python' ;
28+ let executable = environment . execInfo ?. activatedRun ?. executable ?? environment . execInfo ?. run . executable ?? 'python' ;
29+ executable = quoteArg ( executable ) ;
3030 const args = environment . execInfo ?. activatedRun ?. args ?? environment . execInfo ?. run . args ?? [ ] ;
3131 const allArgs = [ ...args , ...options . args ] ;
3232
You can’t perform that action at this time.
0 commit comments