Skip to content

Commit f1de3b4

Browse files
Don't use symlink directory in the path of the program name
This is a workaround for the issue that the argv0 program path containing a symlink directory in the path causes `Bundle.main` to crash.
1 parent 133488c commit f1de3b4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

IntegrationTests/lib.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ import { SwiftRuntime } from "javascript-kit-swift"
22
import { WASI as NodeWASI } from "wasi"
33
import { WASI as MicroWASI, useAll } from "uwasi"
44
import * as fs from "fs/promises"
5+
import path from "path";
56

67
const WASI = {
78
MicroWASI: ({ programName }) => {
89
const wasi = new MicroWASI({
9-
args: [programName],
10+
args: [path.basename(programName)],
1011
env: {},
1112
features: [useAll()],
1213
})
@@ -21,7 +22,7 @@ const WASI = {
2122
},
2223
Node: ({ programName }) => {
2324
const wasi = new NodeWASI({
24-
args: [programName],
25+
args: [path.basename(programName)],
2526
env: {},
2627
preopens: {
2728
"/": "./",

0 commit comments

Comments
 (0)