Update action

This commit is contained in:
Anton Medvedev 2021-10-15 22:41:21 +02:00
commit 2c2db8c641
59 changed files with 1430 additions and 4763 deletions

30
node_modules/execa/lib/command.js generated vendored
View file

@ -1,14 +1,33 @@
'use strict';
const SPACES_REGEXP = / +/g;
const joinCommand = (file, args = []) => {
const normalizeArgs = (file, args = []) => {
if (!Array.isArray(args)) {
return file;
return [file];
}
return [file, ...args].join(' ');
return [file, ...args];
};
const NO_ESCAPE_REGEXP = /^[\w.-]+$/;
const DOUBLE_QUOTES_REGEXP = /"/g;
const escapeArg = arg => {
if (typeof arg !== 'string' || NO_ESCAPE_REGEXP.test(arg)) {
return arg;
}
return `"${arg.replace(DOUBLE_QUOTES_REGEXP, '\\"')}"`;
};
const joinCommand = (file, args) => {
return normalizeArgs(file, args).join(' ');
};
const getEscapedCommand = (file, args) => {
return normalizeArgs(file, args).map(arg => escapeArg(arg)).join(' ');
};
const SPACES_REGEXP = / +/g;
// Handle `execa.command()`
const parseCommand = command => {
const tokens = [];
@ -28,5 +47,6 @@ const parseCommand = command => {
module.exports = {
joinCommand,
getEscapedCommand,
parseCommand
};