From 60640d4fe446e41839e8d0551d86b4484cffb419 Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Sun, 15 Mar 2020 19:02:45 +0100 Subject: [PATCH 1/2] install_update_linux: allow specifying directory Closes #208 --- scripts/install_update_linux.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 From 86302e8ccc889e6794529f9779b10b622f1f8e72 Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Sun, 15 Mar 2020 19:08:50 +0100 Subject: [PATCH 2/2] README: mention DIR env variable --- README.md | 2 ++ 1 file changed, 2 insertions(+) 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**