[wp-trac] [WordPress Trac] #49491: Escape command arguments of env:cli before passing to docker-compose
WordPress Trac
noreply at wordpress.org
Sat Feb 22 14:48:04 UTC 2020
#49491: Escape command arguments of env:cli before passing to docker-compose
------------------------------+----------------------------
Reporter: ocean90 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Build/Test Tools | Version: 5.3
Severity: normal | Keywords: needs-patch
Focuses: |
------------------------------+----------------------------
`npm run env:cli option update blogname "foo bar"` currently fails with
"Error: Too many positional arguments: bar". This is because "foo bar"
isn't passed with the quotes to docker-compose.
{{{
> WordPress at 5.4.0 env:cli /WordPress/wordpress-core
> node ./tools/local-env/scripts/docker.js run cli "option" "update"
"blogname" "foo bar"
Error: Too many positional arguments: bar
child_process.js:660
throw err;
^
Error: Command failed: docker-compose run cli option update blogname foo
bar
at checkExecSyncError (child_process.js:621:11)
at execSync (child_process.js:657:15)
at Object.<anonymous> (/WordPress/wordpress-core/tools/local-
env/scripts/docker.js:6:1)
at Module._compile (internal/modules/cjs/loader.js:955:30)
at Object.Module._extensions..js
(internal/modules/cjs/loader.js:991:10)
at Module.load (internal/modules/cjs/loader.js:811:32)
at Function.Module._load (internal/modules/cjs/loader.js:723:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)
at internal/main/run_main_module.js:17:11 {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 32760,
stdout: null,
stderr: null
}
}}}
Maybe we can use something like https://www.npmjs.com/package/shell-quote?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49491>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list