0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-07 00:50:23 -05:00

fix(install): Fix checking for docker compose. (#663)

This commit is contained in:
Brett Profitt 2022-09-10 12:48:50 -04:00 committed by GitHub
parent f88ff4fb5c
commit 4ed647c43d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,10 +6,6 @@ RED='\033[0;31m'
GREEN='\032[0;31m' GREEN='\032[0;31m'
NC='\033[0m' # No Color NC='\033[0m' # No Color
machine_has() {
type "$1" >/dev/null 2>&1
}
create_immich_directory() { create_immich_directory() {
echo "Creating Immich directory..." echo "Creating Immich directory..."
mkdir -p ./immich-app/immich-data mkdir -p ./immich-app/immich-data
@ -45,18 +41,21 @@ populate_upload_location() {
start_docker_compose() { start_docker_compose() {
echo "Starting Immich's docker containers" echo "Starting Immich's docker containers"
if machine_has "docker compose"; then { if docker compose &> /dev/null; then
docker compose up --remove-orphans -d docker_bin="docker compose"
elif docker-compose &> /dev/null; then
show_friendly_message docker_bin="docker-compose"
exit 0 else
}; fi echo 'Cannot find `docker compose` or `docker-compose`.'
exit 1
if machine_has "docker-compose"; then fi
docker-compose up --remove-orphans -d
if $docker_bin up --remove-orphans -d; then
show_friendly_message show_friendly_message
exit 0 exit 0
else
echo "Could not start. Check for errors above."
exit 1
fi fi
} }