@ai-ecoverse/slicc-jsh 0.3.8 → 0.3.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.
@@ -1,6 +1,6 @@
1
1
  // src/host/main.mjs
2
2
  import { spawn as spawnChild } from "node:child_process";
3
- import { accessSync, constants as fsConstants, readFileSync, writeSync } from "node:fs";
3
+ import { accessSync, constants as fsConstants, readFileSync, realpathSync, writeSync } from "node:fs";
4
4
  import { createRequire } from "node:module";
5
5
  import { constants as osConstants } from "node:os";
6
6
  import { delimiter, join, resolve } from "node:path";
@@ -10,7 +10,7 @@ import vm from "node:vm";
10
10
  // package.json
11
11
  var package_default = {
12
12
  name: "@ai-ecoverse/slicc-jsh",
13
- version: "0.3.8",
13
+ version: "0.3.9",
14
14
  description: "Node.js-compatible runtime for slicc-kernel: the node and jsh commands (abi: js)",
15
15
  type: "module",
16
16
  license: "Apache-2.0",
@@ -890,9 +890,14 @@ async function main() {
890
890
  ${JSH_USAGE}`);
891
891
  process.exit(parsed.status);
892
892
  }
893
- const filename = resolve(parsed.script);
894
- process.argv = [process.execPath, filename, ...parsed.args];
893
+ const given = resolve(parsed.script);
894
+ process.argv = [process.execPath, given, ...parsed.args];
895
895
  silenceLoaderWarning();
896
+ let filename = given;
897
+ try {
898
+ filename = realpathSync(given);
899
+ } catch {
900
+ }
896
901
  await runJsh({ filename, engine, process, console });
897
902
  }
898
903
  main().catch((err) => {