Skip to content

Commit

Permalink
feat: Make installer work with parallel installations
Browse files Browse the repository at this point in the history
  • Loading branch information
Timo Reymann authored and Timo Reymann committed Jul 20, 2022
1 parent 176ea69 commit 0d98778
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions installer
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ _ok() {
exit 1
fi

_pid="$$"

if [ "${UID:-$(id -u)}" -ne 0 ]; then
echo -n "Installer is not running as root, trying to use sudo ..."
SUDO="sudo"
Expand Down Expand Up @@ -47,11 +49,11 @@ _ok() {
_ok

echo -n "Download binary for ${latest_version} ... "
curl -LsS https://github.com/timo-reymann/deterministic-zip/releases/download/${latest_version}/${artifact} -o /tmp/deterministic-zip
curl -LsS https://github.com/timo-reymann/deterministic-zip/releases/download/${latest_version}/${artifact} -o /tmp/deterministic-zip.${_pid}
_ok

echo -n "Installing to /usr/local/bin ..."
$SUDO mv /tmp/deterministic-zip /usr/local/bin/deterministic-zip
$SUDO mv /tmp/deterministic-zip.${_pid} /usr/local/bin/deterministic-zip
$SUDO chmod +x /usr/local/bin/deterministic-zip
_ok
}

0 comments on commit 0d98778

Please sign in to comment.