Skip to content

Commit

Permalink
ci(auto-update): fix hash file not changed in the right place
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgomesdev committed Dec 22, 2023
1 parent 7231a6a commit 3ac160b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/scripts/auto-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ build () {

newest_hash=$(sha256sum "$BINARY_PATH" | gawk '{print $1}')

echo "$newest_hash" > "$HASH_FILE"
echo "$SUCCESS* Built successfully!$RESET"
}

Expand Down Expand Up @@ -127,7 +126,10 @@ if [[ -f "$HASH_FILE" ]]; then
current_hash=$(cat "$HASH_FILE")
update
if [[ "$current_hash" != "$newest_hash" ]]; then
echo "$INFO* Built a new version!$RESET"
newest_hash=$(sha256sum "$BINARY_PATH" | gawk '{print $1}')

echo "$newest_hash" > "$HASH_FILE"
echo "$INFO* There is a new version!$RESET"
launch
else
echo "$INFO* Version is already up-to-date.$RESET"
Expand Down

0 comments on commit 3ac160b

Please sign in to comment.