Skip to content

Commit

Permalink
validate version
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpapst committed Aug 17, 2023
1 parent 7fddf37 commit a854693
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ exclude:
- package.json
- _site
- src
- scripts
- scripts/*.sh
- vendor
- CNAME
- LICENSE
Expand Down
5 changes: 5 additions & 0 deletions scripts/update-version-number.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ fi

new_value="$1"

if [[ ! $new_value =~ ^2\.(0|[1-9]*)(0?)\.(0|[0-9]*)(0?)$ ]]; then
echo "Invalid version number: $new_value"
exit 1
fi

# Use awk to update the kimai_v2_version value in the CONFIG_FILE
awk -v new_version="$new_value" '/kimai_v2_version:/ {$2 = "\"" new_version "\""} 1' "$CONFIG_FILE" > temp.yml && mv temp.yml "$CONFIG_FILE"

Expand Down

0 comments on commit a854693

Please sign in to comment.