escalator/install.sh

43 lines
717 B
Bash
Executable File

#!/usr/bin/env bash
if [ ! -d www ]; then
echo Symlinking the escalator-web directory
ln -s `realpath ../escalator-web` `realpath www`
fi
mkdir -p platforms
if [ ! -d platforms/android ]; then
echo "Installing android platform for cordova"
cordova platform add android
fi
build() {
echo "Building android app"
cd ./platforms/android/app/
gradle build
}
deploy() {
cd ./platforms/android/app/
if [ ! -d build ]; then
build
fi
cd build/outputs/apk/debug/
echo "Removing the previous version if any"
adb uninstall com.escalator.escalator
echo "Installing app"
adb -d install app-debug.apk
}
if [ $# -gt 0 ]; then
"$@"
else
deploy
fi