-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create the script for generating the binaries. This closes #8
- 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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 .. |