mythix-cli 1.3.1 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/mythix-cli.js +7 -1
- package/package.json +1 -1
package/bin/mythix-cli.js
CHANGED
|
@@ -32,6 +32,10 @@ function spawnCommand(command, args, options) {
|
|
|
32
32
|
(async function () {
|
|
33
33
|
let config;
|
|
34
34
|
|
|
35
|
+
// Windows hack
|
|
36
|
+
if(!process.env.PWD)
|
|
37
|
+
process.env.PWD = process.cwd();
|
|
38
|
+
|
|
35
39
|
let argOptions = CMDed(({ $, store }) => {
|
|
36
40
|
$('--config', Types.STRING({
|
|
37
41
|
format: Path.resolve,
|
|
@@ -51,13 +55,15 @@ function spawnCommand(command, args, options) {
|
|
|
51
55
|
const args = process.argv.slice(2);
|
|
52
56
|
const runtime = argOptions.runtime || config.runtime || 'node';
|
|
53
57
|
const runtimeArgs = config.runtimeArgs || [];
|
|
54
|
-
const
|
|
58
|
+
const hasCMD = ((/\.cmd$/i).test(runtime));
|
|
59
|
+
const commands = [ runtime, (process.platform == 'win32' && !hasCMD) ? `${runtime}.cmd` : undefined ].filter(Boolean);
|
|
55
60
|
|
|
56
61
|
for (let i = 0, il = commands.length; i < il; i++) {
|
|
57
62
|
let command = commands[i];
|
|
58
63
|
|
|
59
64
|
try {
|
|
60
65
|
await spawnCommand(command, runtimeArgs.concat([ Path.resolve(__dirname, 'runner.js') ], args));
|
|
66
|
+
break;
|
|
61
67
|
} catch (error) {
|
|
62
68
|
if (error.code === 'ENOENT' && (i + 1) < commands.length)
|
|
63
69
|
continue;
|