diff --git a/README.md b/README.md index 0b72d879..326db2d9 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,8 @@ Automated install/update, don't forget to always verify what you're piping into curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash ``` +The script installs downloaded binary to `/usr/local/bin` directory by default, but it can be changed by setting `DIR` environment variable. + ### Go Required Go version >= **1.8** diff --git a/scripts/install_update_linux.sh b/scripts/install_update_linux.sh index 781a0f58..d4e0cee0 100755 --- a/scripts/install_update_linux.sh +++ b/scripts/install_update_linux.sh @@ -1,5 +1,8 @@ #!/bin/bash +# allow specifying different destination directory +DIR="${DIR:-"/usr/local/bin"}" + # map different architecture variations to the available binaries ARCH=$(uname -m) case $ARCH in @@ -17,5 +20,5 @@ GITHUB_URL="https://github.com/jesseduffield/lazydocker/releases/download/${GITH # install/update the local binary curl -L -o lazydocker.tar.gz $GITHUB_URL tar xzvf lazydocker.tar.gz lazydocker -sudo mv -f lazydocker /usr/local/bin/ +sudo mv -f lazydocker "$DIR" rm lazydocker.tar.gz