Make /opt/moonarch root-owned for multi-user support
Remove chown from archinstall custom-commands so the repo stays root:root. Use sudo for git operations in update.sh. Any user with sudo can now run moonarch-update without owning the repo.
This commit is contained in:
+6
-6
@@ -15,17 +15,17 @@ check_not_root
|
||||
log "=== Update Moonarch repo ==="
|
||||
|
||||
cd "$PROJECT_DIR"
|
||||
if git rev-parse --is-inside-work-tree &>/dev/null; then
|
||||
LOCAL=$(git rev-parse HEAD)
|
||||
git fetch origin
|
||||
REMOTE=$(git rev-parse @{u} 2>/dev/null || echo "$LOCAL")
|
||||
if sudo git rev-parse --is-inside-work-tree &>/dev/null; then
|
||||
LOCAL=$(sudo git rev-parse HEAD)
|
||||
sudo git fetch origin
|
||||
REMOTE=$(sudo git rev-parse @{u} 2>/dev/null || echo "$LOCAL")
|
||||
|
||||
if [[ "$LOCAL" != "$REMOTE" ]]; then
|
||||
log "Updates available."
|
||||
git --no-pager log --oneline "$LOCAL".."$REMOTE"
|
||||
sudo git --no-pager log --oneline "$LOCAL".."$REMOTE"
|
||||
echo ""
|
||||
if confirm "Update repo?"; then
|
||||
git pull --ff-only
|
||||
sudo git pull --ff-only
|
||||
log "Repo updated."
|
||||
else
|
||||
log "Repo update skipped."
|
||||
|
||||
Reference in New Issue
Block a user