@dotenvx/dotenvx
Advanced tools
Comparing version 0.7.1 to 0.7.2
{ | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"name": "@dotenvx/dotenvx", | ||
@@ -4,0 +4,0 @@ "description": "a better dotenv–from the creator of `dotenv`", |
@@ -22,6 +22,16 @@ const fs = require('fs') | ||
const executeCommand = async function (subCommand, env) { | ||
const signals = [ | ||
'SIGHUP', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGABRT', | ||
'SIGBUS', 'SIGFPE', 'SIGUSR1', 'SIGSEGV', 'SIGUSR2', 'SIGTERM' | ||
] | ||
logger.debug(`executing subcommand ${subCommand}`) | ||
// handler for SIGINT | ||
let subprocess | ||
const sigintHandler = () => { | ||
logger.debug('received SIGINT') | ||
if (subprocess) { | ||
logger.debug('sending SIGINT to subprocess') | ||
subprocess.kill('SIGINT') // Send SIGINT to the subprocess | ||
@@ -31,2 +41,6 @@ } | ||
const handleOtherSignal = (signal) => { | ||
logger.debug(`received ${signal}`) | ||
} | ||
try { | ||
@@ -40,2 +54,6 @@ const subprocess = execa(subCommand[0], subCommand.slice(1), { | ||
signals.forEach(signal => { | ||
process.on(signal, () => handleOtherSignal(signal)) | ||
}) | ||
// Wait for the subprocess to finish | ||
@@ -45,2 +63,3 @@ const { exitCode } = await subprocess | ||
if (exitCode !== 0) { | ||
logger.debug(`received exitCode ${exitCode}`) | ||
throw new Error(`Command failed with exit code ${exitCode}`) | ||
@@ -47,0 +66,0 @@ } |
30432
612