mirror of
https://github.com/89luca89/distrobox.git
synced 2026-08-19 01:14:49 -05:00
install: add --next flag to install latest commit from git
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
This commit is contained in:
@@ -295,6 +295,18 @@ or if you want to select a custom directory to install without sudo:
|
||||
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sh -s -- --prefix ~/.local
|
||||
```
|
||||
|
||||
If you want to install the last development version, directly from last commit on git, you can use:
|
||||
|
||||
```sh
|
||||
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sudo sh -s -- --next
|
||||
```
|
||||
|
||||
or:
|
||||
|
||||
```sh
|
||||
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sh -s -- --next --prefix ~/.local
|
||||
```
|
||||
|
||||
Alternatively you can clone the project using `git clone` or using the latest
|
||||
release [HERE](https://github.com/89luca89/distrobox/releases/latest).
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
# POSIX
|
||||
|
||||
next=0
|
||||
verbose=0
|
||||
|
||||
# Print usage to stdout.
|
||||
@@ -57,6 +58,12 @@ while :; do
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
-N | --next)
|
||||
if [ -n "$2" ]; then
|
||||
shift
|
||||
next=1
|
||||
fi
|
||||
;;
|
||||
-P | --prefix)
|
||||
if [ -n "$2" ]; then
|
||||
prefix="$2"
|
||||
@@ -122,10 +129,14 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
release_ver=$(curl -L https://github.com/89luca89/distrobox/releases/latest |
|
||||
grep 'refs/tags' | tail -1 | cut -d'"' -f2)
|
||||
release_name=$(echo "${release_ver}" | rev | cut -d'/' -f1 | rev)
|
||||
|
||||
if [ "${next}" -eq 0 ]; then
|
||||
release_ver=$(curl -L https://github.com/89luca89/distrobox/releases/latest |
|
||||
grep 'refs/tags' | tail -1 | cut -d'"' -f2)
|
||||
release_name=$(echo "${release_ver}" | rev | cut -d'/' -f1 | rev)
|
||||
else
|
||||
release_ver="89luca89/distrobox/archive/refs/heads/main.tar.gz"
|
||||
release_name="main"
|
||||
fi
|
||||
# go in tmp
|
||||
tmp_dir="$(mktemp -d)"
|
||||
cd "${tmp_dir}"
|
||||
|
||||
Reference in New Issue
Block a user