Move a few bash scripts to contrib directory

This commit is contained in:
Kelson 2019-09-13 12:45:14 +02:00
parent 48de529bcf
commit 8dda5c9fd8
3 changed files with 19 additions and 21 deletions

View File

@ -16,8 +16,7 @@ fi
function die { function die {
echo -n "[ERROR] " echo -n "[ERROR] "
echo -n $1 echo -n $1
echo -n " Aborting. echo -n " Aborting."
"
exit 1 exit 1
} }
@ -31,7 +30,6 @@ if [ "x$2" != "x" ];
PACKAGE=$2 PACKAGE=$2
fi fi
if [ "x$3" != "x" ]; if [ "x$3" != "x" ];
then then
APP_VERSION=$3 APP_VERSION=$3

View File

@ -1,19 +1,19 @@
#!/bin/bash #!/bin/bash
# default value is guessed from repo (AndroidManifest) # default value is guessed from repo (AndroidManifest)
PACKAGE=$(python -c "from xml.dom.minidom import parse; d=parse('app/src/main/AndroidManifest.xml'); print([e.getAttribute('package').strip() for e in d.getElementsByTagName('manifest')][-1])") PACKAGE=$(python -c "from xml.dom.minidom import parse; d=parse('../app/src/main/AndroidManifest.xml'); print([e.getAttribute('package').strip() for e in d.getElementsByTagName('manifest')][-1])")
if [ "x$1" != "x" ]; if [ "x$1" != "x" ];
then then
PACKAGE=$1 PACKAGE=$1
fi fi
if [ -f app/build/outputs/apk/${PACKAGE}-debug.apk ] if [ -f ../app/build/outputs/apk/${PACKAGE}-debug.apk ]
then then
echo "Uninstalling old Kiwix APK..." echo "Uninstalling old Kiwix APK..."
${ANDROID_HOME}/platform-tools/adb uninstall ${PACKAGE} ; ${ANDROID_HOME}/platform-tools/adb uninstall ${PACKAGE} ;
echo "Installing new Kiwix APK..." echo "Installing new Kiwix APK..."
${ANDROID_HOME}/platform-tools/adb install build/outputs/apk/${PACKAGE}-debug.apk ${ANDROID_HOME}/platform-tools/adb install ../build/outputs/apk/${PACKAGE}-debug.apk
else else
echo "No APK file available for package ${PACKAGE} !" echo "No APK file available for package ${PACKAGE} !"
fi fi