From a4d13e75175b384f69f18a3b99533c056fb01fb0 Mon Sep 17 00:00:00 2001 From: Matthew Giannini Date: Wed, 20 Nov 2024 13:55:48 -0500 Subject: [PATCH] sys:es,nodeJs: move node vars to fantom.js boot --- src/nodeJs/res/fantomTemplate.js | 5 +++++ src/sys/es/fan/BootEnv.js | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nodeJs/res/fantomTemplate.js b/src/nodeJs/res/fantomTemplate.js index c16b7d74b..99b0cbfd1 100644 --- a/src/nodeJs/res/fantomTemplate.js +++ b/src/nodeJs/res/fantomTemplate.js @@ -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 diff --git a/src/sys/es/fan/BootEnv.js b/src/sys/es/fan/BootEnv.js index 95d8efd3c..d6861375a 100644 --- a/src/sys/es/fan/BootEnv.js +++ b/src/sys/es/fan/BootEnv.js @@ -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}//sys.js - this.#vars.set("node.path", path.resolve(url.fileURLToPath(import.meta.url), "../..")); } for (let i=0; i