-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add script in crement version number by 1 (#10)
chore: add script to increment version number by 1
- Loading branch information
1 parent
0821b4c
commit fc7d421
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
# https://stackoverflow.com/questions/59895/how-do-i-get-the-directory-where-a-bash-script-is-located-from-within-the-script | ||
ROOT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/../ | ||
|
||
# Find the current version | ||
CURRENT_VERSION=$(grep -o "version: .*" ${ROOT_DIR}/resources/metabase-plugin.yaml | cut -c 10-) | ||
|
||
# Increment the version | ||
NEW_VERSION=$(echo $CURRENT_VERSION | awk -F. -v OFS=. '{$NF += 1 ; print}') | ||
|
||
echo "Incrementing version from ${CURRENT_VERSION} to ${NEW_VERSION}" | ||
|
||
# Update the version | ||
FILES=(${ROOT_DIR}/resources/metabase-plugin.yaml ${ROOT_DIR}/project.clj) | ||
for i in ${!FILES[@]}; do | ||
sed -i "s/${CURRENT_VERSION}/${NEW_VERSION}/g" ${FILES[$i]} | ||
done |