Skip to content

Commit

Permalink
Check exit code directly, not indirectly with $?
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterDaveHello committed Mar 23, 2019
1 parent 1866217 commit fb47010
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bin/n
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,7 @@ install() {
is_ok "$url" || is_oss_ok "$url" || abort "invalid version $version"

log mkdir "$dir"
mkdir -p "$dir"
if [ $? -ne 0 ] ; then
if ! mkdir -p "$dir"; then
abort "sudo required"
else
touch "$dir/n.lock"
Expand Down

0 comments on commit fb47010

Please sign in to comment.