2019-05-23 00:44:08 +00:00
|
|
|
diff --git a/node_modules/qqjs/node_modules/execa/index.js b/node_modules/qqjs/node_modules/execa/index.js
|
2019-07-03 21:50:53 +00:00
|
|
|
index 06f3969..8bca191 100644
|
2019-05-23 00:44:08 +00:00
|
|
|
--- a/node_modules/qqjs/node_modules/execa/index.js
|
|
|
|
+++ b/node_modules/qqjs/node_modules/execa/index.js
|
2019-06-03 15:02:32 +00:00
|
|
|
@@ -14,6 +14,17 @@ const stdio = require('./lib/stdio');
|
2019-05-23 00:44:08 +00:00
|
|
|
|
|
|
|
const TEN_MEGABYTES = 1000 * 1000 * 10;
|
|
|
|
|
|
|
|
+// OSTYPE is 'msys' for MSYS 1.0 and for MSYS2, or 'cygwin' for Cygwin
|
|
|
|
+// but note that OSTYPE is not "exported" by default, so run: export OSTYPE=$OSTYPE
|
|
|
|
+// MSYSTEM is 'MINGW32' for MSYS 1.0, 'MSYS' for MSYS2, and undefined for Cygwin
|
2019-06-03 15:02:32 +00:00
|
|
|
+const isCygwin = process.env.OSTYPE === 'cygwin';
|
|
|
|
+const isMinGW = process.env.MSYSTEM && process.env.MSYSTEM.startsWith('MINGW');
|
|
|
|
+const isMSYS2 = process.env.MSYSTEM && process.env.MSYSTEM.startsWith('MSYS');
|
2019-05-23 00:44:08 +00:00
|
|
|
+
|
|
|
|
+console.log(`[patched execa] detected "${
|
|
|
|
+ isCygwin ? 'Cygwin' : isMinGW ? 'MinGW' : isMSYS2 ? 'MSYS2' : 'standard'
|
2019-06-03 15:02:32 +00:00
|
|
|
+}" environment (MSYSTEM="${process.env.MSYSTEM}")`);
|
2019-05-23 00:44:08 +00:00
|
|
|
+
|
|
|
|
function handleArgs(cmd, args, opts) {
|
|
|
|
let parsed;
|
|
|
|
|
2019-07-03 21:50:53 +00:00
|
|
|
@@ -104,13 +115,22 @@ function handleShell(fn, cmd, opts) {
|
2019-05-23 00:44:08 +00:00
|
|
|
|
|
|
|
opts = Object.assign({}, opts);
|
|
|
|
|
|
|
|
- if (process.platform === 'win32') {
|
|
|
|
+ if (isMSYS2 || isMinGW || isCygwin) {
|
|
|
|
+ file = process.env.MSYSSHELLPATH ||
|
|
|
|
+ (isMSYS2 ? 'C:\\msys64\\usr\\bin\\bash.exe' :
|
|
|
|
+ (isMinGW ? 'C:\\MinGW\\msys\\1.0\\bin\\bash.exe' :
|
|
|
|
+ (isCygwin ? 'C:\\cygwin64\\bin\\bash.exe' : file)));
|
|
|
|
+ }
|
|
|
|
+ else if (process.platform === 'win32') {
|
|
|
|
opts.__winShell = true;
|
|
|
|
file = process.env.comspec || 'cmd.exe';
|
|
|
|
args = ['/s', '/c', `"${cmd}"`];
|
|
|
|
opts.windowsVerbatimArguments = true;
|
|
|
|
}
|
|
|
|
|
2019-07-03 21:50:53 +00:00
|
|
|
+ const argStr = (args && args.length) ? `["${args.join('", "')}"]` : args;
|
|
|
|
+ console.log(`[patched execa] handleShell file="${file}" args=${argStr}`);
|
2019-05-23 00:44:08 +00:00
|
|
|
+
|
|
|
|
if (opts.shell) {
|
|
|
|
file = opts.shell;
|
|
|
|
delete opts.shell;
|
2019-07-03 21:50:53 +00:00
|
|
|
@@ -199,6 +219,9 @@ module.exports = (cmd, args, opts) => {
|
|
|
|
const maxBuffer = parsed.opts.maxBuffer;
|
|
|
|
const joinedCmd = joinCmd(cmd, args);
|
|
|
|
|
|
|
|
+ const argStr = (args && args.length) ? `["${args.join('", "')}"]` : args;
|
|
|
|
+ console.log(`[patched execa] parsed.cmd="${parsed.cmd}" parsed.args=${argStr}`);
|
|
|
|
+
|
|
|
|
let spawned;
|
|
|
|
try {
|
|
|
|
spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
|
|
|
|
@@ -364,3 +387,7 @@ module.exports.sync = (cmd, args, opts) => {
|
2019-06-03 15:02:32 +00:00
|
|
|
module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
|
|
|
|
|
|
|
|
module.exports.spawn = util.deprecate(module.exports, 'execa.spawn() is deprecated. Use execa() instead.');
|
|
|
|
+
|
|
|
|
+module.exports.isCygwin = isCygwin;
|
|
|
|
+module.exports.isMinGW = isMinGW;
|
|
|
|
+module.exports.isMSYS2 = isMSYS2;
|