Skip to content
This repository was archived by the owner on May 16, 2020. It is now read-only.

Commit 072b2ec

Browse files
fix(app): when on Windows, try to use the cmd
1 parent f4441f4 commit 072b2ec

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,8 @@
1717
"engines": {
1818
"node": ">= 8",
1919
"npm": ">= 5"
20+
},
21+
"dependencies": {
22+
"is-windows": "~1.0.1"
2023
}
2124
}

packages/atlauncher-scripts/utils.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const fs = require('fs');
22
const path = require('path');
33
const spawn = require('cross-spawn');
44
const colors = require('colors/safe');
5+
const isWindows = require('is-windows');
56

67
function getProjectBasePath() {
78
return path.resolve(process.cwd());
@@ -69,6 +70,14 @@ function getNodeModulesPath(filename) {
6970
}
7071

7172
function getNodeModulesBinPath(packageName) {
73+
if (isWindows()) {
74+
const cmdBin = getNodeModulesPath(`.bin/${packageName}.cmd`);
75+
76+
if (fs.existsSync(cmdBin)) {
77+
return cmdBin;
78+
}
79+
}
80+
7281
return getNodeModulesPath(`.bin/${packageName}`);
7382
}
7483

0 commit comments

Comments
 (0)