Merge pull request #209 from jesseduffield/dawidd6-patch-1

install_update_linux: allow specifying directory
This commit is contained in:
Dawid Dziurla 2020-03-20 00:21:19 +01:00 committed by GitHub
commit 10617da560
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -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**

View file

@ -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