mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-22 16:02:24 +00:00
fix: improve ts wrappers (#3163)
This commit is contained in:
@@ -483,7 +483,9 @@ async function run() {{
|
||||
await fs.writeFile("result.json", res_json);
|
||||
process.exit(0);
|
||||
}}
|
||||
run().catch(async (e) => {{
|
||||
try {{
|
||||
await run();
|
||||
}} catch(e) {{
|
||||
let err = {{ message: e.message, name: e.name, stack: e.stack }};
|
||||
let step_id = process.env.WM_FLOW_STEP_ID;
|
||||
if (step_id) {{
|
||||
@@ -491,7 +493,7 @@ run().catch(async (e) => {{
|
||||
}}
|
||||
await fs.writeFile("result.json", JSON.stringify(err));
|
||||
process.exit(1);
|
||||
}});
|
||||
}}
|
||||
"#,
|
||||
);
|
||||
write_file(job_dir, "wrapper.ts", &wrapper_content).await?;
|
||||
@@ -707,7 +709,15 @@ plugin(p)
|
||||
.stderr(Stdio::piped());
|
||||
bun_cmd
|
||||
};
|
||||
start_child_process(cmd, &*BUN_PATH).await?
|
||||
start_child_process(
|
||||
cmd,
|
||||
if annotation.nodejs_mode {
|
||||
&*NODE_PATH
|
||||
} else {
|
||||
&*BUN_PATH
|
||||
},
|
||||
)
|
||||
.await?
|
||||
};
|
||||
|
||||
handle_child(
|
||||
|
||||
@@ -223,7 +223,9 @@ async function run() {{
|
||||
await Deno.writeTextFile("result.json", res_json);
|
||||
Deno.exit(0);
|
||||
}}
|
||||
run().catch(async (e) => {{
|
||||
try {{
|
||||
await run();
|
||||
}} catch(e) {{
|
||||
let err = {{ message: e.message, name: e.name, stack: e.stack }};
|
||||
let step_id = Deno.env.get("WM_FLOW_STEP_ID");
|
||||
if (step_id) {{
|
||||
@@ -231,7 +233,7 @@ run().catch(async (e) => {{
|
||||
}}
|
||||
await Deno.writeTextFile("result.json", JSON.stringify(err));
|
||||
Deno.exit(1);
|
||||
}});
|
||||
}}
|
||||
"#,
|
||||
);
|
||||
write_file(job_dir, "wrapper.ts", &wrapper_content).await?;
|
||||
|
||||
Reference in New Issue
Block a user