Fix permissions (#26)

* [fix-permissions] Use sudo password for permission for /usr/local

* [fix-permissions] Add sudo for g++ compilation

* [fix-permissions] Correct sudo permission in uninstall script
This commit is contained in:
Rico Tiongson 2018-02-28 00:57:21 +08:00 committed by GitHub
parent 91b55bad5e
commit 0de8777d87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -17,7 +17,8 @@ fi
abort () {
exec echo "Installation aborted"
}
mkdir -p $(dirname $CONF_PATH) || abort
sudo mkdir -p $(dirname $CONF_PATH) || abort
sudo chown $USER $(dirname $CONF_PATH)
if [ ! -f $CONF_PATH ]; then
if [ ! -f $OLD_CONF_PATH ]; then
# old config file not found, create from scratch
@ -44,7 +45,7 @@ else
fi
echo "Installing..."
# mkdir -p ~/.local/bin
g++ -std=c++11 -O2 $DIR/src/comfortable-swipe.cpp -lxdo -o $PROGRAM || exec echo "Installation aborted"
sudo g++ -std=c++11 -O2 $DIR/src/comfortable-swipe.cpp -lxdo -o $PROGRAM || exec echo "Installation aborted"
GROUP=$(ls -l /dev/input/event* | awk '{print $4}' | head --line=1) || abort

View File

@ -3,5 +3,5 @@ echo "Uninstalling..."
rm ${XDG_CONFIG_HOME:-$HOME/.config}/autostart/comfortable-swipe.desktop 2> /dev/null
comfortable-swipe stop 2> /dev/null
rm $HOME/.local/bin/comfortable-swipe 2> /dev/null # compat
rm /usr/local/bin/comfortable-swipe 2> /dev/null
sudo rm /usr/local/bin/comfortable-swipe 2> /dev/null
echo "Successfully uninstalled comfortable-swipe"