mirror of
https://github.com/github/codeql-action.git
synced 2025-12-26 09:10:07 +08:00
17 lines
446 B
JavaScript
17 lines
446 B
JavaScript
import process from 'node:process';
|
|
|
|
import arrgv from 'arrgv';
|
|
|
|
export default function normalizeNodeArguments(fromConf = [], fromArgv = '') {
|
|
let parsedArgv = [];
|
|
if (fromArgv !== '') {
|
|
try {
|
|
parsedArgv = arrgv(fromArgv);
|
|
} catch {
|
|
throw new Error('Could not parse `--node-arguments` value. Make sure all strings are closed and backslashes are used correctly.');
|
|
}
|
|
}
|
|
|
|
return [...process.execArgv, ...fromConf, ...parsedArgv];
|
|
}
|