@mytegroupinc/myte-core 0.0.27 → 0.0.28
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/package.json
CHANGED
|
@@ -100,9 +100,15 @@ function stableScenarioList(raw, confirmLive) {
|
|
|
100
100
|
];
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
function commandForPlatform(command) {
|
|
104
|
+
if (process.platform !== "win32") return command;
|
|
105
|
+
if (command.endsWith(".cmd") || command.endsWith(".exe")) return command;
|
|
106
|
+
return `${command}.cmd`;
|
|
107
|
+
}
|
|
108
|
+
|
|
103
109
|
function cliInvocation(args, cliMode, packageVersion) {
|
|
104
|
-
if (cliMode === "global") return { command: "myte", args };
|
|
105
|
-
if (cliMode === "npx") return { command: "npx", args: ["--yes", `myte@${packageVersion}`, ...args] };
|
|
110
|
+
if (cliMode === "global") return { command: commandForPlatform("myte"), args };
|
|
111
|
+
if (cliMode === "npx") return { command: commandForPlatform("npx"), args: ["--yes", `myte@${packageVersion}`, ...args] };
|
|
106
112
|
return { command: process.execPath, args: [CLI_PATH, ...args] };
|
|
107
113
|
}
|
|
108
114
|
|
|
@@ -129,20 +135,22 @@ function runCli(cliArgs, options = {}) {
|
|
|
129
135
|
cwd: workspace || process.cwd(),
|
|
130
136
|
env: process.env,
|
|
131
137
|
encoding: "utf8",
|
|
138
|
+
shell: process.platform === "win32" && /\.(cmd|bat)$/i.test(invocation.command),
|
|
132
139
|
stdio: ["ignore", "pipe", "pipe"],
|
|
133
140
|
timeout: timeoutMs,
|
|
134
141
|
});
|
|
135
142
|
const stdout = String(result.stdout || "").trim();
|
|
136
143
|
const stderr = String(result.stderr || "").trim();
|
|
137
144
|
const ok = result.status === 0;
|
|
145
|
+
const processError = result.error ? String(result.error.message || result.error) : "";
|
|
138
146
|
if (expectFailure) {
|
|
139
147
|
if (ok) {
|
|
140
148
|
throw new Error(`Expected command to fail but it succeeded: ${commandText(invocation)}`);
|
|
141
149
|
}
|
|
142
|
-
return { ok: false, status: result.status, stdout, stderr };
|
|
150
|
+
return { ok: false, status: result.status, stdout, stderr, error: processError };
|
|
143
151
|
}
|
|
144
152
|
if (!ok) {
|
|
145
|
-
throw new Error([`Command failed: ${commandText(invocation)}`, stderr || stdout || "(no output)"].join("\n"));
|
|
153
|
+
throw new Error([`Command failed: ${commandText(invocation)}`, processError || stderr || stdout || "(no output)"].join("\n"));
|
|
146
154
|
}
|
|
147
155
|
if (!parseJson) return { ok: true, stdout, stderr };
|
|
148
156
|
try {
|
|
@@ -277,7 +285,7 @@ class Harness {
|
|
|
277
285
|
this.key = getProjectKey();
|
|
278
286
|
this.actorBase = String(args["actor-scope"] || `mission-live-full-${nowId()}`);
|
|
279
287
|
this.cliMode = String(args.cli || "local").toLowerCase();
|
|
280
|
-
this.packageVersion = String(args["package-version"] || "0.0.
|
|
288
|
+
this.packageVersion = String(args["package-version"] || "0.0.28");
|
|
281
289
|
this.batchSize = Math.max(1, Math.min(10, Number(args["batch-size"] || 10)));
|
|
282
290
|
this.includeQaqcRun = args["include-qaqc-run"] === true;
|
|
283
291
|
this.workspace = path.resolve(
|