Skip to content

Commit

Permalink
Create the script for generating the binaries. This closes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
Angel M De Miguel committed Jun 12, 2017
1 parent b67f305 commit 591ff8d
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions scripts/create_binaries.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash -e

if ! which pkg >/dev/null; then
echo -e "pkg is required. Please install it before run this script: npm install -g pkg"
exit 1
fi

# Install
rm -r ./build/*
pkg --out-dir ./build .

# Get the version
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g' \
| tr -d '[[:space:]]')

# Rename and compress
cd build

echo "Compressing for Linux"
mv ./svgi-linux ./svgi
tar -zcf ./svgi-linux-x64-$PACKAGE_VERSION.tar.gz ./svgi
rm ./svgi

echo "Compressing for MacOS"
mv ./svgi-macos ./svgi
tar -zcf ./svgi-macos-x64-$PACKAGE_VERSION.tar.gz ./svgi
rm ./svgi

echo "Compressing for Windows"
mv ./svgi-win.exe ./svgi.exe
tar -zcf ./svgi-win-x64-$PACKAGE_VERSION.tar.gz ./svgi.exe
rm ./svgi.exe

echo "Done!"
cd ..

0 comments on commit 591ff8d

Please sign in to comment.