Permalink
Browse files

Oneliners now will automatically use sudo if /usr/local is not writeable

  • Loading branch information...
1 parent 2cd1f4c commit 300a8bc2a1b033d56822b13541d1c9f7eeafef27 @yrashk yrashk committed Feb 15, 2011
Showing with 14 additions and 8 deletions.
  1. +0 −6 README.md
  2. +6 −1 scripts/oneliner
  3. +8 −1 scripts/oneliner.release
View
@@ -21,12 +21,6 @@ If you want to install latest release instead of HEAD, use this one:
curl https://github.com/agner/agner/raw/master/scripts/oneliner.release | sh
-### Configuration
-
-If your `/usr/local` isn't writeable to your user, either set your
-`AGNER_PREFIX` variable to point to some writeable location or use
-`sudo sh`.
-
Motivation
----------
View
@@ -1 +1,6 @@
-DIR=`mktemp -u /tmp/agner.XXXXXX` && git clone https://github.com/agner/agner.git $DIR && cd $DIR && make && ./agner install agner && echo Fetching index... && agner list -d | awk '{printf "."; fflush()}' && echo && rm -rf $DIR
+DIR=`mktemp -u /tmp/agner.XXXXXX` &&
+git clone https://github.com/agner/agner.git $DIR &&
+cd $DIR && make &&
+if [ -w /usr/local ]; then ./agner install agner; else sudo ./agner install agner; fi &&
+echo Fetching index... &&
+agner list -d | awk '{printf "."; fflush()}' && echo && rm -rf $DIR
View
@@ -1 +1,8 @@
-DIR=`mktemp -u /tmp/agner.XXXXXX` && git clone https://github.com/agner/agner.git $DIR && cd $DIR && git checkout -b release origin/release && make && ./agner install agner -v @release && echo Fetching index... && agner list -d | awk '{printf "."; fflush()}' && echo && rm -rf $DIR
+DIR=`mktemp -u /tmp/agner.XXXXXX` &&
+git clone https://github.com/agner/agner.git $DIR &&
+cd $DIR &&
+git checkout -b release origin/release &&
+make &&
+if [ -w /usr/local ]; then ./agner install agner -v @release; else sudo ./agner install agner -v @release; fi &&
+echo Fetching index... &&
+agner list -d | awk '{printf "."; fflush()}' && echo && rm -rf $DIR

0 comments on commit 300a8bc

Please sign in to comment.