shell: docker run needs shell

don't want to get into parsing quotes!
This commit is contained in:
Girish Ramakrishnan
2024-02-22 10:34:56 +01:00
parent a6f078330f
commit 60994f9ed1
4 changed files with 42 additions and 41 deletions

View File

@@ -50,12 +50,13 @@ async function execArgs(tag, file, args, options) {
});
}
// default encoding utf8, shell, handles input, full command
// default encoding utf8, no shell, handles input, full command
async function exec(tag, cmd, options) {
assert.strictEqual(typeof tag, 'string');
assert.strictEqual(typeof cmd, 'string');
assert.strictEqual(typeof options, 'object');
cmd = options.shell ? cmd : cmd.replace(/\s+/g, ' '); // collapse spaces when not using shell. note: no more complexity like parsing quotes here!
const [file, ...args] = cmd.split(' ');
return await execArgs(tag, file, args, options);
}