mirror of
https://github.com/deployphp/action.git
synced 2025-06-28 20:24:14 +00:00
Update action
This commit is contained in:
parent
c17d254b53
commit
2c2db8c641
59 changed files with 1430 additions and 4763 deletions
14
node_modules/execa/index.d.ts
generated
vendored
14
node_modules/execa/index.d.ts
generated
vendored
|
@ -252,10 +252,20 @@ declare namespace execa {
|
|||
|
||||
interface ExecaReturnBase<StdoutStderrType> {
|
||||
/**
|
||||
The file and arguments that were run.
|
||||
The file and arguments that were run, for logging purposes.
|
||||
|
||||
This is not escaped and should not be executed directly as a process, including using `execa()` or `execa.command()`.
|
||||
*/
|
||||
command: string;
|
||||
|
||||
/**
|
||||
Same as `command` but escaped.
|
||||
|
||||
This is meant to be copy and pasted into a shell, for debugging purposes.
|
||||
Since the escaping is fairly basic, this should not be executed directly as a process, including using `execa()` or `execa.command()`.
|
||||
*/
|
||||
escapedCommand: string;
|
||||
|
||||
/**
|
||||
The numeric exit code of the process that was run.
|
||||
*/
|
||||
|
@ -497,7 +507,7 @@ declare const execa: {
|
|||
|
||||
If the file or an argument contains spaces, they must be escaped with backslashes. This matters especially if `command` is not a constant but a variable, for example with `__dirname` or `process.cwd()`. Except for spaces, no escaping/quoting is needed.
|
||||
|
||||
The `shell` option must be used if the `command` uses shell-specific features, as opposed to being a simple `file` followed by its `arguments`.
|
||||
The `shell` option must be used if the `command` uses shell-specific features (for example, `&&` or `||`), as opposed to being a simple `file` followed by its `arguments`.
|
||||
|
||||
@param command - The program/script to execute and its arguments.
|
||||
@returns A [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties.
|
||||
|
|
18
node_modules/execa/index.js
generated
vendored
18
node_modules/execa/index.js
generated
vendored
|
@ -7,10 +7,10 @@ const npmRunPath = require('npm-run-path');
|
|||
const onetime = require('onetime');
|
||||
const makeError = require('./lib/error');
|
||||
const normalizeStdio = require('./lib/stdio');
|
||||
const {spawnedKill, spawnedCancel, setupTimeout, setExitHandler} = require('./lib/kill');
|
||||
const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = require('./lib/stream.js');
|
||||
const {mergePromise, getSpawnedPromise} = require('./lib/promise.js');
|
||||
const {joinCommand, parseCommand} = require('./lib/command.js');
|
||||
const {spawnedKill, spawnedCancel, setupTimeout, validateTimeout, setExitHandler} = require('./lib/kill');
|
||||
const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = require('./lib/stream');
|
||||
const {mergePromise, getSpawnedPromise} = require('./lib/promise');
|
||||
const {joinCommand, parseCommand, getEscapedCommand} = require('./lib/command');
|
||||
|
||||
const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100;
|
||||
|
||||
|
@ -74,6 +74,9 @@ const handleOutput = (options, value, error) => {
|
|||
const execa = (file, args, options) => {
|
||||
const parsed = handleArguments(file, args, options);
|
||||
const command = joinCommand(file, args);
|
||||
const escapedCommand = getEscapedCommand(file, args);
|
||||
|
||||
validateTimeout(parsed.options);
|
||||
|
||||
let spawned;
|
||||
try {
|
||||
|
@ -87,6 +90,7 @@ const execa = (file, args, options) => {
|
|||
stderr: '',
|
||||
all: '',
|
||||
command,
|
||||
escapedCommand,
|
||||
parsed,
|
||||
timedOut: false,
|
||||
isCanceled: false,
|
||||
|
@ -119,6 +123,7 @@ const execa = (file, args, options) => {
|
|||
stderr,
|
||||
all,
|
||||
command,
|
||||
escapedCommand,
|
||||
parsed,
|
||||
timedOut,
|
||||
isCanceled: context.isCanceled,
|
||||
|
@ -134,6 +139,7 @@ const execa = (file, args, options) => {
|
|||
|
||||
return {
|
||||
command,
|
||||
escapedCommand,
|
||||
exitCode: 0,
|
||||
stdout,
|
||||
stderr,
|
||||
|
@ -159,6 +165,7 @@ module.exports = execa;
|
|||
module.exports.sync = (file, args, options) => {
|
||||
const parsed = handleArguments(file, args, options);
|
||||
const command = joinCommand(file, args);
|
||||
const escapedCommand = getEscapedCommand(file, args);
|
||||
|
||||
validateInputSync(parsed.options);
|
||||
|
||||
|
@ -172,6 +179,7 @@ module.exports.sync = (file, args, options) => {
|
|||
stderr: '',
|
||||
all: '',
|
||||
command,
|
||||
escapedCommand,
|
||||
parsed,
|
||||
timedOut: false,
|
||||
isCanceled: false,
|
||||
|
@ -190,6 +198,7 @@ module.exports.sync = (file, args, options) => {
|
|||
signal: result.signal,
|
||||
exitCode: result.status,
|
||||
command,
|
||||
escapedCommand,
|
||||
parsed,
|
||||
timedOut: result.error && result.error.code === 'ETIMEDOUT',
|
||||
isCanceled: false,
|
||||
|
@ -205,6 +214,7 @@ module.exports.sync = (file, args, options) => {
|
|||
|
||||
return {
|
||||
command,
|
||||
escapedCommand,
|
||||
exitCode: 0,
|
||||
stdout,
|
||||
stderr,
|
||||
|
|
30
node_modules/execa/lib/command.js
generated
vendored
30
node_modules/execa/lib/command.js
generated
vendored
|
@ -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
|
||||
};
|
||||
|
|
2
node_modules/execa/lib/error.js
generated
vendored
2
node_modules/execa/lib/error.js
generated
vendored
|
@ -33,6 +33,7 @@ const makeError = ({
|
|||
signal,
|
||||
exitCode,
|
||||
command,
|
||||
escapedCommand,
|
||||
timedOut,
|
||||
isCanceled,
|
||||
killed,
|
||||
|
@ -61,6 +62,7 @@ const makeError = ({
|
|||
|
||||
error.shortMessage = shortMessage;
|
||||
error.command = command;
|
||||
error.escapedCommand = escapedCommand;
|
||||
error.exitCode = exitCode;
|
||||
error.signal = signal;
|
||||
error.signalDescription = signalDescription;
|
||||
|
|
11
node_modules/execa/lib/kill.js
generated
vendored
11
node_modules/execa/lib/kill.js
generated
vendored
|
@ -71,10 +71,6 @@ const setupTimeout = (spawned, {timeout, killSignal = 'SIGTERM'}, spawnedPromise
|
|||
return spawnedPromise;
|
||||
}
|
||||
|
||||
if (!Number.isFinite(timeout) || timeout < 0) {
|
||||
throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
|
||||
}
|
||||
|
||||
let timeoutId;
|
||||
const timeoutPromise = new Promise((resolve, reject) => {
|
||||
timeoutId = setTimeout(() => {
|
||||
|
@ -89,6 +85,12 @@ const setupTimeout = (spawned, {timeout, killSignal = 'SIGTERM'}, spawnedPromise
|
|||
return Promise.race([timeoutPromise, safeSpawnedPromise]);
|
||||
};
|
||||
|
||||
const validateTimeout = ({timeout}) => {
|
||||
if (timeout !== undefined && (!Number.isFinite(timeout) || timeout < 0)) {
|
||||
throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
|
||||
}
|
||||
};
|
||||
|
||||
// `cleanup` option handling
|
||||
const setExitHandler = async (spawned, {cleanup, detached}, timedPromise) => {
|
||||
if (!cleanup || detached) {
|
||||
|
@ -108,5 +110,6 @@ module.exports = {
|
|||
spawnedKill,
|
||||
spawnedCancel,
|
||||
setupTimeout,
|
||||
validateTimeout,
|
||||
setExitHandler
|
||||
};
|
||||
|
|
2
node_modules/execa/lib/stream.js
generated
vendored
2
node_modules/execa/lib/stream.js
generated
vendored
|
@ -6,7 +6,7 @@ const mergeStream = require('merge-stream');
|
|||
// `input` option
|
||||
const handleInput = (spawned, input) => {
|
||||
// Checking for stdin is workaround for https://github.com/nodejs/node/issues/26852
|
||||
// TODO: Remove `|| spawned.stdin === undefined` once we drop support for Node.js <=12.2.0
|
||||
// @todo remove `|| spawned.stdin === undefined` once we drop support for Node.js <=12.2.0
|
||||
if (input === undefined || spawned.stdin === undefined) {
|
||||
return;
|
||||
}
|
||||
|
|
173
node_modules/execa/package.json
generated
vendored
173
node_modules/execa/package.json
generated
vendored
|
@ -1,103 +1,74 @@
|
|||
{
|
||||
"_from": "execa@5.0.0",
|
||||
"_id": "execa@5.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==",
|
||||
"_location": "/execa",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "execa@5.0.0",
|
||||
"name": "execa",
|
||||
"escapedName": "execa",
|
||||
"rawSpec": "5.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "5.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER",
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz",
|
||||
"_shasum": "4029b0007998a841fbd1032e5f4de86a3c1e3376",
|
||||
"_spec": "execa@5.0.0",
|
||||
"_where": "/Users/andrei/Projects/forks/deployphp-action",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/execa/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"cross-spawn": "^7.0.3",
|
||||
"get-stream": "^6.0.0",
|
||||
"human-signals": "^2.1.0",
|
||||
"is-stream": "^2.0.0",
|
||||
"merge-stream": "^2.0.0",
|
||||
"npm-run-path": "^4.0.1",
|
||||
"onetime": "^5.1.2",
|
||||
"signal-exit": "^3.0.3",
|
||||
"strip-final-newline": "^2.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Process execution for humans",
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.14.10",
|
||||
"ava": "^2.4.0",
|
||||
"get-node": "^11.0.1",
|
||||
"is-running": "^2.1.0",
|
||||
"nyc": "^15.1.0",
|
||||
"p-event": "^4.2.0",
|
||||
"tempfile": "^3.0.0",
|
||||
"tsd": "^0.13.1",
|
||||
"xo": "^0.35.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts",
|
||||
"lib"
|
||||
],
|
||||
"funding": "https://github.com/sindresorhus/execa?sponsor=1",
|
||||
"homepage": "https://github.com/sindresorhus/execa#readme",
|
||||
"keywords": [
|
||||
"exec",
|
||||
"child",
|
||||
"process",
|
||||
"execute",
|
||||
"fork",
|
||||
"execfile",
|
||||
"spawn",
|
||||
"file",
|
||||
"shell",
|
||||
"bin",
|
||||
"binary",
|
||||
"binaries",
|
||||
"npm",
|
||||
"path",
|
||||
"local"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "execa",
|
||||
"nyc": {
|
||||
"exclude": [
|
||||
"**/fixtures/**",
|
||||
"**/test.js",
|
||||
"**/test/**"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/execa.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && nyc ava && tsd"
|
||||
},
|
||||
"version": "5.0.0"
|
||||
"name": "execa",
|
||||
"version": "5.1.1",
|
||||
"description": "Process execution for humans",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/execa",
|
||||
"funding": "https://github.com/sindresorhus/execa?sponsor=1",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && nyc ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts",
|
||||
"lib"
|
||||
],
|
||||
"keywords": [
|
||||
"exec",
|
||||
"child",
|
||||
"process",
|
||||
"execute",
|
||||
"fork",
|
||||
"execfile",
|
||||
"spawn",
|
||||
"file",
|
||||
"shell",
|
||||
"bin",
|
||||
"binary",
|
||||
"binaries",
|
||||
"npm",
|
||||
"path",
|
||||
"local"
|
||||
],
|
||||
"dependencies": {
|
||||
"cross-spawn": "^7.0.3",
|
||||
"get-stream": "^6.0.0",
|
||||
"human-signals": "^2.1.0",
|
||||
"is-stream": "^2.0.0",
|
||||
"merge-stream": "^2.0.0",
|
||||
"npm-run-path": "^4.0.1",
|
||||
"onetime": "^5.1.2",
|
||||
"signal-exit": "^3.0.3",
|
||||
"strip-final-newline": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.14.10",
|
||||
"ava": "^2.4.0",
|
||||
"get-node": "^11.0.1",
|
||||
"is-running": "^2.1.0",
|
||||
"nyc": "^15.1.0",
|
||||
"p-event": "^4.2.0",
|
||||
"tempfile": "^3.0.0",
|
||||
"tsd": "^0.13.1",
|
||||
"xo": "^0.35.0"
|
||||
},
|
||||
"nyc": {
|
||||
"reporter": [
|
||||
"text",
|
||||
"lcov"
|
||||
],
|
||||
"exclude": [
|
||||
"**/fixtures/**",
|
||||
"**/test.js",
|
||||
"**/test/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
19
node_modules/execa/readme.md
generated
vendored
19
node_modules/execa/readme.md
generated
vendored
|
@ -1,7 +1,7 @@
|
|||
<img src="media/logo.svg" width="400">
|
||||
<br>
|
||||
|
||||
[](https://codecov.io/gh/sindresorhus/execa)
|
||||
[](https://codecov.io/gh/sindresorhus/execa)
|
||||
|
||||
> Process execution for humans
|
||||
|
||||
|
@ -68,6 +68,7 @@ const execa = require('execa');
|
|||
originalMessage: 'spawn unknown ENOENT',
|
||||
shortMessage: 'Command failed with ENOENT: unknown command spawn unknown ENOENT',
|
||||
command: 'unknown command',
|
||||
escapedCommand: 'unknown command',
|
||||
stdout: '',
|
||||
stderr: '',
|
||||
all: '',
|
||||
|
@ -121,6 +122,7 @@ try {
|
|||
originalMessage: 'spawnSync unknown ENOENT',
|
||||
shortMessage: 'Command failed with ENOENT: unknown command spawnSync unknown ENOENT',
|
||||
command: 'unknown command',
|
||||
escapedCommand: 'unknown command',
|
||||
stdout: '',
|
||||
stderr: '',
|
||||
all: '',
|
||||
|
@ -200,7 +202,7 @@ Same as [`execa()`](#execafile-arguments-options) except both file and arguments
|
|||
|
||||
If the file or an argument contains spaces, they must be escaped with backslashes. This matters especially if `command` is not a constant but a variable, for example with `__dirname` or `process.cwd()`. Except for spaces, no escaping/quoting is needed.
|
||||
|
||||
The [`shell` option](#shell) must be used if the `command` uses shell-specific features, as opposed to being a simple `file` followed by its `arguments`.
|
||||
The [`shell` option](#shell) must be used if the `command` uses shell-specific features (for example, `&&` or `||`), as opposed to being a simple `file` followed by its `arguments`.
|
||||
|
||||
### execa.commandSync(command, options?)
|
||||
|
||||
|
@ -234,7 +236,18 @@ The child process [fails](#failed) when:
|
|||
|
||||
Type: `string`
|
||||
|
||||
The file and arguments that were run.
|
||||
The file and arguments that were run, for logging purposes.
|
||||
|
||||
This is not escaped and should not be executed directly as a process, including using [`execa()`](#execafile-arguments-options) or [`execa.command()`](#execacommandcommand-options).
|
||||
|
||||
#### escapedCommand
|
||||
|
||||
Type: `string`
|
||||
|
||||
Same as [`command`](#command) but escaped.
|
||||
|
||||
This is meant to be copy and pasted into a shell, for debugging purposes.
|
||||
Since the escaping is fairly basic, this should not be executed directly as a process, including using [`execa()`](#execafile-arguments-options) or [`execa.command()`](#execacommandcommand-options).
|
||||
|
||||
#### exitCode
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue