@infly/libs 2.0.50 → 2.0.52
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/cli/project-command.js +8 -1
- package/package.json +1 -1
package/cli/project-command.js
CHANGED
|
@@ -78,10 +78,16 @@ function commandParts(command) {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
function defaultRunCommand(command, args, options) {
|
|
81
|
-
|
|
81
|
+
// Windows: node_modules/.bin 的 npm-script 命令是 .CMD 批处理垫片,
|
|
82
|
+
// execFileSync 无 shell 时 CreateProcess 只解析 .exe → ENOENT;与 build-utils/command.js 约定一致。
|
|
83
|
+
const useShell = process.platform === "win32";
|
|
84
|
+
// shell=true 时按 build-utils/command.js 约定传单字符串,规避 DEP0190
|
|
85
|
+
const [cmd, cmdArgs] = useShell ? [[command, ...args].join(" "), []] : [command, args];
|
|
86
|
+
execFileSync(cmd, cmdArgs, {
|
|
82
87
|
cwd: options.cwd,
|
|
83
88
|
env: options.env,
|
|
84
89
|
stdio: "inherit",
|
|
90
|
+
shell: useShell,
|
|
85
91
|
});
|
|
86
92
|
}
|
|
87
93
|
|
|
@@ -196,4 +202,5 @@ module.exports = {
|
|
|
196
202
|
loadConfig,
|
|
197
203
|
resolveBuildPlatforms,
|
|
198
204
|
runProjectCommand,
|
|
205
|
+
defaultRunCommand,
|
|
199
206
|
};
|