Skip to content

Commit

Permalink
Merge pull request #250 from dxw/add-force-update-flag
Browse files Browse the repository at this point in the history
Add 'force_update' flag
  • Loading branch information
Stretch96 authored Feb 23, 2024
2 parents 0a946c5 + 642f412 commit 3909165
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions bin/configure-commands/update
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@ set -o pipefail
usage() {
echo "Usage: $(basename "$0") [OPTIONS]" 1>&2
echo " -g <git_auth_token> - Git Auth token (Optional - only required if dalmatian tools repo is private)"
echo " -f <force_update> - Force update (Runs through the upate process even if dalmatian-tools is on the latest version)"
echo " -h - help"
exit 1
}

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

while getopts "g:h" opt; do
FORCE_UPDATE=0
while getopts "g:fh" opt; do
case $opt in
g)
GIT_AUTH_TOKEN=$OPTARG
;;
f)
FORCE_UPDATE=1
;;
h)
usage
;;
Expand Down Expand Up @@ -51,7 +55,10 @@ fi
LATEST_REMOTE_TAG=$(echo "$RELEASE_JSON" | jq -r '.name')
CURRENT_LOCAL_TAG=$(git -C "$APP_ROOT" describe --tags)
LOCAL_CHANGES=$(git -C "$APP_ROOT" status --porcelain)
if [ "$LATEST_REMOTE_TAG" != "$CURRENT_LOCAL_TAG" ]
if [[
"$LATEST_REMOTE_TAG" != "$CURRENT_LOCAL_TAG" ||
"$FORCE_UPDATE" == 1
]]
then
if [ -n "$LOCAL_CHANGES" ]
then
Expand Down

0 comments on commit 3909165

Please sign in to comment.