mirror of
https://github.com/deployphp/action.git
synced 2025-06-29 12:44:14 +00:00
Update action
This commit is contained in:
parent
c17d254b53
commit
2c2db8c641
59 changed files with 1430 additions and 4763 deletions
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
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue