From ed15d55885a42249be399bd120a94adffaf80268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Hall=C3=A9n?= Date: Fri, 19 Jun 2015 08:43:57 +0200 Subject: [PATCH 1/2] Escape variable so script does not break on space in username --- bin/lein-pkg | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/lein-pkg b/bin/lein-pkg index ed2174394..d669b07ab 100644 --- a/bin/lein-pkg +++ b/bin/lein-pkg @@ -6,7 +6,9 @@ export LEIN_VERSION="2.5.2-SNAPSHOT" -if [ `whoami` = "root" ] && [ "$LEIN_ROOT" = "" ]; then +export USR=`whoami` + +if [ "$USR" = "root" ] && [ "$LEIN_ROOT" = "" ]; then echo "WARNING: You're currently running as root; probably by accident." echo "Press control-C to abort or Enter to continue as root." echo "Set LEIN_ROOT to disable this warning." From d49399853b4ebf4294f58b01e998db81efb791fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Hall=C3=A9n?= Date: Fri, 19 Jun 2015 13:41:11 +0200 Subject: [PATCH 2/2] Fixed unnecessary variable --- bin/lein-pkg | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/lein-pkg b/bin/lein-pkg index d669b07ab..8508ace21 100644 --- a/bin/lein-pkg +++ b/bin/lein-pkg @@ -6,9 +6,7 @@ export LEIN_VERSION="2.5.2-SNAPSHOT" -export USR=`whoami` - -if [ "$USR" = "root" ] && [ "$LEIN_ROOT" = "" ]; then +if [ "`whoami`" = "root" ] && [ "$LEIN_ROOT" = "" ]; then echo "WARNING: You're currently running as root; probably by accident." echo "Press control-C to abort or Enter to continue as root." echo "Set LEIN_ROOT to disable this warning."