mirror of
https://github.com/github/codeql-action.git
synced 2025-12-26 17:20:10 +08:00
18 lines
455 B
JavaScript
18 lines
455 B
JavaScript
'use strict';
|
|
const arrgv = require('arrgv');
|
|
|
|
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];
|
|
}
|
|
|
|
module.exports = normalizeNodeArguments;
|