Skip to content

Commit

Permalink
Simplify task arguments construction in taskprovider.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Sep 18, 2024
1 parent 1fb5ebf commit f28ea45
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/vscode/src/taskprovider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function activeTaskProvider(state: ExtensionState) {
provideTasks: async () => {
try {
const { cliPath, cliVersion } = await resolveCli()
const exec = shellQuote([cliPath ?? `npx`])
const exec = shellQuote([cliPath || `npx`])
const exeArgs = cliPath
? []
: ["--yes", `genaiscript@${cliVersion}`]
Expand All @@ -24,12 +24,9 @@ export async function activeTaskProvider(state: ExtensionState) {
host.projectFolder(),
script.filename
)
const args = [
...exeArgs,
"run",
scriptName,
"${relativeFile}",
]
const args = [...exeArgs, "run", scriptName]
if (vscode.window.activeTextEditor)
args.push("${relativeFile}")
const task = new vscode.Task(
{ type: TOOL_ID, script: script.filename },
vscode.TaskScope.Workspace,
Expand Down

0 comments on commit f28ea45

Please sign in to comment.