diff --git a/install.sh b/install.sh index 2654116..8ea38a6 100755 --- a/install.sh +++ b/install.sh @@ -73,6 +73,10 @@ if [ "${1:-}" = "-update" ]; then cd "$INSTALL_DIR" fi + # Reset ownership so the app user can write files. + APP_USER="${APP_USER:-${SUDO_USER:-$(whoami)}}" + sudo_if chown -R "${APP_USER}:${APP_USER}" "$INSTALL_DIR" 2>/dev/null || true + # Backup the database before making any changes. if [ -f "$INSTALL_DIR/expenses.db" ]; then BACKUP_DIR="$INSTALL_DIR/backups"