Skip to content

Commit

Permalink
sys:es,nodeJs: move node vars to fantom.js boot
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Giannini authored and Matthew Giannini committed Nov 20, 2024
1 parent f09108a commit a4d13e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/nodeJs/res/fantomTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ const boot = async function(opts={}) {
Env.cur().__homeDir = File.os(fan_home);
Env.cur().__workDir = File.os(fan_home);
Env.cur().__tempDir = File.os(toDir(path.resolve(fan_home, "temp")));
Env.cur().__loadVars({
"node.version": process.versions.node,
"node.path": path.resolve(url.fileURLToPath(import.meta.url), "../..")
});

await checkPathEnv();

// handle polyfills
Expand Down
5 changes: 0 additions & 5 deletions src/sys/es/fan/BootEnv.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,8 @@ class BootEnv extends Env {

// set some pre-defined vars
if (Env.__isNode()) {
let path = Env.__node("path");
let url = Env.__node("url");
this.#vars.set("os.name", this.os());
this.#vars.set("os.version", Env.__node()?.os?.version());
this.#vars.set("node.version", process.versions.node);
// this assumes that sys.js is in {node.path}/<some_dir>/sys.js
this.#vars.set("node.path", path.resolve(url.fileURLToPath(import.meta.url), "../.."));
}

for (let i=0; i<keys.length; ++i) {
Expand Down

0 comments on commit a4d13e7

Please sign in to comment.