File tree 1 file changed +9
-8
lines changed
1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -euxo pipefail
3
- gh () {
3
+ check_gh () {
4
4
# Check if `gh` command is available
5
- if ! command -v gh > /dev/null; then
6
- echo " The CLI utility 'gh' was not found"
5
+ if command -v gh > /dev/null 2>&1 ; then
6
+ echo " OK: GitHub CLI 'gh' found"
7
+ gh --version
7
8
return 0
8
9
else
9
- echo " OK: CLI utility 'gh' found"
10
- return 1
10
+ echo " ERROR: GitHub CLI 'gh' was not found"
11
+ echo " Please install it from https://cli.github.com/"
12
+ return 1
11
13
fi
12
14
}
13
-
14
15
15
16
getversion () {
16
17
new_tag=" v$( grep version " $DIR " /../seqfu.nimble | cut -f 2 -d \" ) "
17
18
# check if gh()
18
- if gh ; then
19
+ if check_gh ; then
19
20
new_tag=$( gh release list -L 1 | grep -o " v\d\+\.\d\+\.\d\+" )
20
21
else
21
- echo " Could not get remote release" "
22
+ echo " Could not get remote release"
22
23
fi
23
24
}
24
25
DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null && pwd ) "
You can’t perform that action at this time.
0 commit comments