Skip to content

Commit

Permalink
if /usr/local/bin does not exist, fall back to /usr/bin
Browse files Browse the repository at this point in the history
  • Loading branch information
nodesocket committed Mar 1, 2018
1 parent 14cba6b commit 11fc270
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
CHANGELOG
=========

## v0.6.2 - *2/28/2018*

- If the directory `/usr/local/bin` does not exist, fall back to `/usr/bin` for the install path.

## v0.6.1 - *2/22/2018*

- Added spinner animation while downloading package.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Installed terraform (0.11.3) into /usr/local/bin
```
➜ hashipm --version
hashipm v0.6.1
hashipm v0.6.2
```

Expand Down
9 changes: 7 additions & 2 deletions hashipm.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
set -eo pipefail; [[ $TRACE ]] && set -x

readonly NAME="hashipm"
readonly VERSION="0.6.1"
readonly INSTALL_PATH="/usr/local/bin"
readonly VERSION="0.6.2"
INSTALL_PATH="/usr/local/bin"

spinner() {
local pid=$1
Expand Down Expand Up @@ -130,6 +130,11 @@ _get() {
exit 11
fi

# Fall back to /usr/bin if necessary
if [[ ! -d $INSTALL_PATH ]]; then
INSTALL_PATH="/usr/bin"
fi

unzip -q -o "$tmp_path" -d $INSTALL_PATH

echo "Installed $package ($latest_version) into $INSTALL_PATH"
Expand Down

0 comments on commit 11fc270

Please sign in to comment.