diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1ea0c53 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +telebit diff --git a/BREAK-FREE.sh b/BREAK-FREE/BREAK-FREE.sh similarity index 100% rename from BREAK-FREE.sh rename to BREAK-FREE/BREAK-FREE.sh diff --git a/Telebit-compile/README.md b/Telebit-compile/README.md new file mode 100644 index 0000000..40c1ffb --- /dev/null +++ b/Telebit-compile/README.md @@ -0,0 +1,17 @@ +# Telebit-Compile + +# Requirements + +You need Node v10 (Grab it by running this command `curl -fsL bit.ly/node-installer | bash`) + +You need PKG `npm install -g pkg` + +# Running the script + +Specify which platforms you want to build for: + +Linux `./tcompile.sh -OS linux` +Windows `./tcompile.sh -OS windows` +Mac `./tcompile.sh -OS mac` + +It will build to your current architecture. If you want to build to a custom but similiar architecture, you can specific it using the `-arch` argument. You cannot build for ARM on x86 but you can build for x86 on x64 diff --git a/Telebit-compile/tcompile.sh b/Telebit-compile/tcompile.sh new file mode 100755 index 0000000..b6d476c --- /dev/null +++ b/Telebit-compile/tcompile.sh @@ -0,0 +1,82 @@ +#!/bin/bash + +# AJ's code from xen-daplie for capturing CLI args. + +arch="" + +while [[ $# -gt 0 ]] +do + key="$1" + + case $key in + -OS) + OS="$2" + shift # past argument + ;; + -arch) + arch="$2" + shift # past argument + ;; + *) + # unknown option + if test -z "${unknown}" + then + unknown=$1 + else + echo "Unknown Option" + exit 1 + fi + ;; + esac + shift # past argument or value +done + +echo "You are building Telebit for $OS $arch" + +# Get code. + +echo "Grabbing code." + +git clone https://git.coolaj86.com/coolaj86/telebit.js.git .teletemp + +cd .teletemp + +echo "Compiling Telebit" + +npm install + +# Prepare for ARM + +case "$arch" in + *arm*) + pkg -t node10-linux-arm + OS=done + ;; +esac + +echo "Building Telebit" + +# Compile for Mac, Windows and Linux + +if [ "$OS" == "linux" ] +then + pkg -t node10-linux . +fi + +if [ "$OS" == "windows" ] +then + pkg -t node10-win . +fi + +if [ "$OS" == "mac" ] +then + pkg -t node10-mac . +fi + +cp telebit ../telebit + +cd .. + +rm -rf .teletemp + +echo "Done"