diff --git a/README.md b/README.md index 6de54ec..854a0ee 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This repository provides instructions and helper scripts to install [Immich](htt * This guide installs Immich to `/var/lib/immich`. To change it, replace it to the directory you want in this README and `install.sh`'s `$IMMICH_PATH`. - * The [install.sh](install.sh) script currently is using Immich v1.117.0. It should be noted that due to the fast-evolving nature of Immich, the install script may get broken if you replace the `$TAG` to something more recent. + * The [install.sh](install.sh) script currently is using Immich v1.117.0. It should be noted that due to the fast-evolving nature of Immich, the install script may get broken if you replace the `$REV` to something more recent. * `mimalloc` is deliberately disabled as this is a native install and sharing system library makes more sense. diff --git a/install.sh b/install.sh index 9267a42..9a12de0 100755 --- a/install.sh +++ b/install.sh @@ -2,7 +2,7 @@ set -xeuo pipefail -TAG=v1.117.0 +REV=v1.117.0 IMMICH_PATH=/var/lib/immich APP=$IMMICH_PATH/app @@ -41,9 +41,14 @@ mkdir -p $IMMICH_PATH/home echo 'umask 077' > $IMMICH_PATH/home/.bashrc TMP=/tmp/immich-$(uuidgen) -git clone https://github.com/immich-app/immich $TMP +if [[ $REV =~ ^[0-9A-Fa-f]+$ ]]; then + # REV is a full commit hash, full clone is required + git clone https://github.com/immich-app/immich $TMP +else + git clone https://github.com/immich-app/immich $TMP --depth=1 -b $REV +fi cd $TMP -git reset --hard $TAG +git reset --hard $REV rm -rf .git # Use 127.0.0.1