From e499de5e023d991e6141cedb5bf2d865c7585efa Mon Sep 17 00:00:00 2001 From: ache Date: Sun, 20 Aug 2017 00:22:46 +0000 Subject: Fix makefile install --- makefile | 8 ++++++-- 1 file 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 -- cgit v1.2.3