1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
#!/bin/bash
set -e
if [ "$UID" = "0" ]; then
echo 'This should not be run as root'
exit 101
fi
NAME=LogOutButton\@kyle.aims.ac.za
function compile-translations {
echo 'Compiling translations...'
for po in locale/*/LC_MESSAGES/*.po; do
msgfmt -cv -o ${po%.po}.mo $po;
done
}
function compile-preferences {
if [ -d src/schemas ]; then
echo 'Compiling preferences...'
glib-compile-schemas --targetdir=src/schemas src/schemas
else
echo 'No preferences to compile... Skipping'
fi
}
function make-local-install {
DEST=~/.local/share/gnome-shell/extensions/$NAME
compile-translations
compile-preferences
echo 'Installing...'
if [ ! -d $DEST ]; then
mkdir -p $DEST
fi
cp -r src/* locale $DEST/
echo 'Done'
}
function make-zip {
if [ -d build ]; then
rm -r build
fi
mkdir build
compile-translations
compile-preferences
echo 'Coping files...'
cp -r LICENSE README.md src/* locale build/
echo 'Creating archive..'
cd build
zip -r ../"$NAME".zip ./*
cd ..
rm -r build
echo 'Done'
}
function useage() {
echo 'Useage: ./install.sh COMMAND'
echo 'COMMAND:'
echo " local-install install the extension in the user's home directory"
echo ' under ~/.local'
echo ' zip Creates a zip file of the extension'
}
case "$1" in
"local-install" )
make-local-install
;;
"zip" )
make-zip
;;
* )
useage
;;
esac
exit
|