You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
1.4 KiB
24 lines
1.4 KiB
// This is a simple setup script in TypeScript that should work for most projects without modification |
|
// The purpose of this script is to install build dependencies (tools like "func" and "fift") automatically |
|
// 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 |
|
if (!fs.existsSync("/app/bin")) { |
|
child_process.execSync(`mkdir bin`); |
|
child_process.execSync(`wget https://github.com/ton-defi-org/ton-binaries/releases/download/ubuntu-16/fift -P ./bin`); |
|
child_process.execSync(`chmod +x ./bin/fift`); |
|
child_process.execSync(`wget https://github.com/ton-defi-org/ton-binaries/releases/download/ubuntu-16/func -P ./bin`); |
|
child_process.execSync(`chmod +x ./bin/func`); |
|
child_process.execSync(`wget https://github.com/ton-defi-org/ton-binaries/releases/download/fiftlib/fiftlib.zip -P ./bin`); |
|
child_process.execSync(`unzip ./bin/fiftlib.zip -d ./bin/fiftlib`); |
|
} |
|
}
|
|
|