aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2017-08-20 00:22:46 +0000
committerache <ache@ache.one>2017-08-20 00:23:01 +0000
commite499de5e023d991e6141cedb5bf2d865c7585efa (patch)
tree4f147e23b5a5a001f6f01067c92290ab960f5fb6
parentt# Ceci est la combinaison de 2 commits. (diff)
Fix makefile install
-rw-r--r--makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/makefile b/makefile
index c033c8a..e2898cb 100644
--- a/makefile
+++ b/makefile
@@ -22,8 +22,12 @@ mrpropest: mrproper
cp ./todo /usr/bin/
install: todo
- [ -e /usr/bin/todo ] && sudo cp todo /usr/bin/todo
- echo 'Installation success'
+ @if [ `id -u` == "0" ] ; then cp -f todo /usr/bin/todo ; else \
+ if which sudo > /dev/null ; then sudo cp -f todo /usr/bin/todo ; else \
+ @echo must be run by superuser ;\
+ fi \
+ fi
+ @echo 'Installation success'
uninstall: /usr/bin/todo
rm /usr/bin/todo