-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* moved bash script, added try catch for async await * Copying bash script to diff dir
- Loading branch information
1 parent
621ce2b
commit fb48178
Showing
2 changed files
with
33 additions
and
14 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,16 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
regexString=$1 | ||
|
||
semanticVersion='' | ||
branchName='' | ||
if [ $regexString ]; then | ||
branchName=$(echo $(git branch -a | grep $regexString | grep -E '([0-9]+\.){2}[0-9]+' | sort --version-sort | tail -n 1 | sed 's@.*/@@')) | ||
semanticVersion=$(echo $(git branch -a | grep $regexString | egrep -o '([0-9]+\.){2}[0-9]+' | sort --version-sort | tail -n 1)) | ||
else | ||
branchName=$(echo $(git branch -a | grep -E '([0-9]+\.){2}[0-9]+' | sort --version-sort | tail -n 1 | sed 's@.*/@@')) | ||
semanticVersion=$(echo $(git branch -a | egrep -o '([0-9]+\.){2}[0-9]+' | sort --version-sort | tail -n 1)) | ||
fi | ||
|
||
echo '{"semanticVersion": "'$semanticVersion'", "branchName": "'$branchName'"}' |
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