Skip to content

Commit

Permalink
Only check for sudo if updating
Browse files Browse the repository at this point in the history
* sudo is only required if there is actually a new version
  • Loading branch information
Stretch96 committed Dec 20, 2023
1 parent 52c0698 commit 4ff6324
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions bin/configure-commands/update
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ usage() {
exit 1
}

log_info -l "Updating dalmatian requires elevated permissions"
log_info -l "Attempting sudo ..."
sudo -v
log_info -l "Elevated permissions are available, continuing ..."

GIT_AUTH_TOKEN="$(jq -r '.dalmatian_update_github_token' < "$CONFIG_SETUP_JSON_FILE")"

while getopts "g:h" opt; do
Expand Down Expand Up @@ -69,6 +64,10 @@ then
exit 0
fi
log_info -l "Updating ..." -q "$QUIET_MODE"
log_info -l "Updating dalmatian requires elevated permissions"
log_info -l "Attempting sudo ..."
sudo -v
log_info -l "Elevated permissions are available, continuing ..."
git -C "$APP_ROOT" checkout main
git -C "$APP_ROOT" pull
git -C "$APP_ROOT" -c advice.detachedHead=false checkout "$LATEST_REMOTE_TAG"
Expand Down

0 comments on commit 4ff6324

Please sign in to comment.