mirror of
https://github.com/iio612/immich-native.git
synced 2026-04-17 12:01:05 +00:00
Conditionally detect Git tags and do a shallow clone
Closes: #20 Signed-off-by: Juhyung Park <qkrwngud825@gmail.com>
This commit is contained in:
11
install.sh
11
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
|
||||
|
||||
Reference in New Issue
Block a user