From 0de8777d87a1689f710780b109d10baa90cbb03a Mon Sep 17 00:00:00 2001 From: Rico Tiongson Date: Wed, 28 Feb 2018 00:57:21 +0800 Subject: [PATCH] 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 --- install | 5 +++-- uninstall | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/install b/install index 36752e1..a3db27b 100755 --- a/install +++ b/install @@ -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 diff --git a/uninstall b/uninstall index 487ead6..59a29bc 100644 --- a/uninstall +++ b/uninstall @@ -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" \ No newline at end of file