Skip to content

Commit

Permalink
fix(CLI): Run invocation on Windows
Browse files Browse the repository at this point in the history
Addresses:

> ERROR: Unknown option "--args,-e"

Reported in InsightSoftwareConsortium#781.
  • Loading branch information
thewtex committed May 5, 2023
1 parent 33abb6b commit a56e9ab
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/itk-wasm-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,24 +196,24 @@ function run(wasmBinary, options) {
let wasmRuntimeArgs = []
switch (wasmRuntime) {
case 'wasmtime':
wasmRuntimeArgs = ['--args', '-e WASMTIME_BACKTRACE_DETAILS=1', '/wasi-runtimes/wasmtime/bin/wasmtime-pwd.sh',]
wasmRuntimeArgs = ['--args', '\'-e WASMTIME_BACKTRACE_DETAILS=1\'', 'wasmtime-pwd.sh',]
break
case 'wasmer':
wasmRuntimeArgs = ['sudo', '/wasi-runtimes/wasmer/bin/wasmer-pwd.sh',]
wasmRuntimeArgs = ['sudo', 'wasmer-pwd.sh',]
break
case 'wasm3':
wasmRuntimeArgs = ['/wasi-runtimes/wasm3/bin/wasm3',]
wasmRuntimeArgs = ['wasm3',]
break
case 'wavm':
wasmRuntimeArgs = ['/wasi-runtimes/wavm/bin/wavm', 'run']
wasmRuntimeArgs = ['wavm', 'run']
break
default:
throw Error('unexpected wasm runtime')
}

if(process.platform === "win32"){
var dockerRun = spawnSync('"C:\\Program Files\\Git\\bin\\sh.exe"',
["--login", "-i", "-c", `"${buildDir}/itk-wasm-build-env ` + wasmRuntimeArgs + wasmBinaryRelativePath + wasmBinaryArgs + '"'], {
["--login", "-i", "-c", `"${buildDir}/itk-wasm-build-env ${wasmRuntimeArgs.join(' ')} ${wasmBinaryRelativePath} ${wasmBinaryArgs.join(' ')}`], {
env: process.env,
stdio: 'inherit',
shell: true
Expand Down

0 comments on commit a56e9ab

Please sign in to comment.