Skip to content

Commit

Permalink
Remove LEIN_ROOT check.
Browse files Browse the repository at this point in the history
It seems like it's much less likely for this to happen unintentionally
these days compared to when it was added.
  • Loading branch information
technomancy committed May 29, 2017
1 parent 141da75 commit d4bfdf4
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 57 deletions.
19 changes: 0 additions & 19 deletions bin/lein
Original file line number Diff line number Diff line change
Expand Up @@ -83,25 +83,6 @@ function self_install {
fi
}

function check_root {
local -i user_id
# Thank you for the complexity, Solaris
if [ "$(uname)" = "SunOS" -a -x /usr/xpg4/bin/id ]; then
user_id=$(/usr/xpg4/bin/id -u 2>/dev/null || echo 0)
else
user_id=$(id -u 2>/dev/null || echo 0)
fi
[ "$user_id" -eq 0 -a "$LEIN_ROOT" = "" ] && return 0
return 1
}

if check_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."
read _
fi

NOT_FOUND=1
ORIGINAL_PWD="$PWD"
while [ ! -r "$PWD/project.clj" ] && [ "$PWD" != "/" ] && [ $NOT_FOUND -ne 0 ]
Expand Down
19 changes: 0 additions & 19 deletions bin/lein-pkg
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,6 @@

export LEIN_VERSION="2.7.2-SNAPSHOT"

function check_root {
local -i user_id
# Thank you for the complexity, Solaris
if [ "$(uname)" = "SunOS" -a -x /usr/xpg4/bin/id ]; then
user_id=$(/usr/xpg4/bin/id -u 2>/dev/null || echo 0)
else
user_id=$(id -u 2>/dev/null || echo 0)
fi
[ "$user_id" -eq 0 -a "$LEIN_ROOT" = "" ] && return 0
return 1
}

if check_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."
read _
fi

# cd to the project root, if applicable
NOT_FOUND=1
ORIGINAL_PWD="$PWD"
Expand Down
19 changes: 0 additions & 19 deletions bin/lein-sdkman
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,6 @@ function add_path {
done
}

function check_root {
local -i user_id
# Thank you for the complexity, Solaris
if [ `uname` = "SunOS" -a -x /usr/xpg4/bin/id ]; then
user_id=$(/usr/xpg4/bin/id -u 2>/dev/null || echo 0)
else
user_id=$(id -u 2>/dev/null || echo 0)
fi
[ $user_id -eq 0 -a "$LEIN_ROOT" = "" ] && return 0
return 1
}

if check_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."
read _
fi

NOT_FOUND=1
ORIGINAL_PWD="$PWD"
while [ ! -r "$PWD/project.clj" ] && [ "$PWD" != "/" ] && [ $NOT_FOUND -ne 0 ]
Expand Down

0 comments on commit d4bfdf4

Please sign in to comment.