Add Telebit Compile script, move Break free

This commit is contained in:
Josh Mudge 2018-10-13 15:34:16 -06:00
parent ff040c28bd
commit 3d290c27ed
4 changed files with 100 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
telebit

17
Telebit-compile/README.md Normal file
View File

@ -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

82
Telebit-compile/tcompile.sh Executable file
View File

@ -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"