Skip to content

Commit

Permalink
Wrapper script fixes and cleaup
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiojr committed Apr 14, 2017
1 parent af03580 commit 6aeb69c
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions script/build-app
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ if [ "$(uname)" != "Darwin" ]; then
exit 1
fi

if [ ! -f beehive ]; then
echo "Run 'make embed' first." >&2
exit 1
fi

if !which nativefier >/dev/null 2>&1; then
echo "nativefier not found!" >&2
echo "npm install -g nativifier" >&2
Expand All @@ -17,14 +22,19 @@ OS_NAME=$(node -e "console.log(os.platform())")
OS_ARCH=$(node -e "console.log(os.arch())")

if [ "$OS_NAME" = "darwin" ]; then
BIN_PATH=build/app/Beehive-$OS_NAME-$OS_ARCH/Beehive.app/Contents/MacOS/
nativefier -e 1.6.6 --icon assets/beehive.icns --name Beehive http://localhost:8181 build/app
mv build/app/Beehive-$OS_NAME-$OS_ARCH/Beehive.app/Contents/MacOS/Beehive build/app/Beehive-$OS_NAME-$OS_ARCH/Beehive.app/Contents/MacOS/Beehive.bin
cp beehive $BIN_PATH/beehived
chmod +x $BIN_PATH/beehived
mv $BIN_PATH/Beehive $BIN_PATH/Beehive.bin

cat > build/app/Beehive-$OS_NAME-$OS_ARCH/Beehive.app/Contents/MacOS/Beehive << "EOF"
cat > $BIN_PATH/Beehive << "EOF"
#!/bin/bash
mkdir -p $HOME/Library/Application\ Support/Beehive
BASE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd )"
$BASE_PATH/Beehive.bin --config $HOME/Library/Application\ Support/Beehive/beehive.conf
LIBRARY_PATH=$HOME/Library/Application\ Support/Beehive
mkdir -p $LIBRARY_PATH
$BASE_PATH/beehived --config $LIBRARY_PATH/beehive.conf &
$BASE_PATH/Beehive.bin
EOF
chmod +x build/app/Beehive-$OS_NAME-$OS_ARCH/Beehive.app/Contents/MacOS/Beehive
fi

0 comments on commit 6aeb69c

Please sign in to comment.