Fix setup_systemd.sh copy issue when running from install dir
Some checks are pending
CI Pipeline / Run Tests (push) Waiting to run
CI Pipeline / Lint Code (push) Waiting to run
CI Pipeline / Security Scan (push) Waiting to run
CI Pipeline / E2E Tests (push) Blocked by required conditions

This commit is contained in:
Enki 2025-08-27 16:05:05 -07:00
parent 270e47f9a6
commit 764aa183dd

View File

@ -104,11 +104,15 @@ echo "📁 Setting up installation directory..."
mkdir -p "$INSTALL_DIR"/{bin,data,configs,logs,backups,web}
mkdir -p "$INSTALL_DIR/data"/{blobs,chunks,transcoded,thumbnails,metadata}
# Copy files
# Copy files (only if not already in install directory)
if [ "$PWD" != "$INSTALL_DIR" ]; then
cp bin/gateway "$INSTALL_DIR/bin/"
cp -r configs/* "$INSTALL_DIR/configs/" 2>/dev/null || true
cp -r internal/web "$INSTALL_DIR/"
cp -r scripts "$INSTALL_DIR/"
else
echo " Already running from install directory, skipping copy"
fi
# Set permissions
chown -R "$SERVICE_USER:$SERVICE_GROUP" "$INSTALL_DIR"