diff --git a/build/_build.ts b/build/_build.ts index ead5264..24e0e3d 100644 --- a/build/_build.ts +++ b/build/_build.ts @@ -18,8 +18,8 @@ async function main() { // if we have an explicit bin directory, use the executables there (needed for glitch.com) if (fs.existsSync("bin")) { - process.env.PATH = __dirname + "/../bin/:" + process.env.PATH; - process.env.FIFTPATH = __dirname + "/../bin/fiftlib"; + process.env.PATH = path.join(__dirname, "..", "bin") + path.delimiter + process.env.PATH; + process.env.FIFTPATH = path.join(__dirname, "..", "bin", "fiftlib"); } // make sure func compiler is available diff --git a/build/_setup.ts b/build/_setup.ts index 86883b5..688468d 100644 --- a/build/_setup.ts +++ b/build/_setup.ts @@ -3,8 +3,12 @@ // We rely on this script for example to support Glitch.com (online IDE) and have it working in one click import fs from "fs"; +import path from "path"; import child_process from "child_process"; +// package ton-compiler brings its own func and fift executables which interfere with the system ones +fs.rmSync(path.join(__dirname, "..", "node_modules", "ton-compiler", "bin"), { recursive: true, force: true }); + // check if we're running on glitch.com (glitch is running Ubuntu 16) if (fs.existsSync("/app/.glitchdotcom.json")) { // make sure we're installed once