@withone/cli 1.13.7 → 1.13.9
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.
|
@@ -451,6 +451,11 @@ function createSandboxedRequire() {
|
|
|
451
451
|
return cache[clean];
|
|
452
452
|
};
|
|
453
453
|
}
|
|
454
|
+
function stripCodeFences(text) {
|
|
455
|
+
const trimmed = text.trim();
|
|
456
|
+
const match = trimmed.match(/^```(?:\w*)\s*\n([\s\S]*?)\n\s*```\s*$/);
|
|
457
|
+
return match ? match[1].trim() : trimmed;
|
|
458
|
+
}
|
|
454
459
|
async function executeActionStep(step, context, api, permissions, allowedActionIds) {
|
|
455
460
|
const action = step.action;
|
|
456
461
|
const platform = resolveValue(action.platform, context);
|
|
@@ -607,7 +612,7 @@ function executeFileReadStep(step, context) {
|
|
|
607
612
|
const filePath = resolveValue(config.path, context);
|
|
608
613
|
const resolvedPath = path.resolve(filePath);
|
|
609
614
|
const content = fs.readFileSync(resolvedPath, "utf-8");
|
|
610
|
-
const output = config.parseJson ? JSON.parse(content) : content;
|
|
615
|
+
const output = config.parseJson ? JSON.parse(stripCodeFences(content)) : content;
|
|
611
616
|
return { status: "success", output, response: output };
|
|
612
617
|
}
|
|
613
618
|
function executeFileWriteStep(step, context) {
|
|
@@ -662,7 +667,7 @@ async function executeSubflowStep(step, context, api, permissions, allowedAction
|
|
|
662
667
|
if (flowStack.includes(resolvedKey)) {
|
|
663
668
|
throw new Error(`Circular flow detected: ${[...flowStack, resolvedKey].join(" \u2192 ")}`);
|
|
664
669
|
}
|
|
665
|
-
const { loadFlow: loadFlow2 } = await import("./flow-runner-
|
|
670
|
+
const { loadFlow: loadFlow2 } = await import("./flow-runner-Y6GBCOM7.js");
|
|
666
671
|
const subFlow = loadFlow2(resolvedKey);
|
|
667
672
|
const subContext = await executeFlow(
|
|
668
673
|
subFlow,
|
|
@@ -743,7 +748,7 @@ async function executeBashStep(step, context, options) {
|
|
|
743
748
|
env,
|
|
744
749
|
maxBuffer: 10 * 1024 * 1024
|
|
745
750
|
});
|
|
746
|
-
const output = config.parseJson ? JSON.parse(stdout) : stdout.trim();
|
|
751
|
+
const output = config.parseJson ? JSON.parse(stripCodeFences(stdout)) : stdout.trim();
|
|
747
752
|
return {
|
|
748
753
|
status: "success",
|
|
749
754
|
output,
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
loadFlow,
|
|
12
12
|
resolveFlowPath,
|
|
13
13
|
saveFlow
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GEQRZGKM.js";
|
|
15
15
|
|
|
16
16
|
// src/index.ts
|
|
17
17
|
import { createRequire as createRequire2 } from "module";
|
|
@@ -3805,7 +3805,7 @@ async function updateCommand() {
|
|
|
3805
3805
|
s.stop(`Update available: v${currentVersion} \u2192 v${latestVersion}`);
|
|
3806
3806
|
console.log(`Updating @withone/cli: v${currentVersion} \u2192 v${latestVersion}...`);
|
|
3807
3807
|
const code = await new Promise((resolve) => {
|
|
3808
|
-
const child = spawn2("npm", ["install", "-g", "@withone/cli@latest"], {
|
|
3808
|
+
const child = spawn2("npm", ["install", "-g", "@withone/cli@latest", "--force"], {
|
|
3809
3809
|
stdio: isAgentMode() ? "pipe" : "inherit",
|
|
3810
3810
|
shell: true
|
|
3811
3811
|
});
|