fix: reset ownership at start of update mode before any file operations
- Moves chown to the very beginning of the update - Ensures app user can write to /opt/receiptnext/ before build - Removes redundant chown later in update (already done upfront)
This commit is contained in:
parent
afd4b6a1cf
commit
b0dfb5fad3
1 changed files with 4 additions and 0 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue