Skip to content
This repository was archived by the owner on Oct 21, 2020. It is now read-only.

Commit d752e29

Browse files
author
pilillo
committed
edited get latest release which was not working on mac os
1 parent c753e2e commit d752e29

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

infrastructure/utils/get_latest_release.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,10 @@
22

33
get_latest_github_release() {
44
# taken from https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c
5-
curl --silent "https://api.github.com/repos/$1/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")'
5+
curl --silent "https://api.github.com/repos/$1/releases/latest" |
6+
grep '"tag_name":' |
7+
sed -E 's/.*"([^"]+)".*/\1/'
68
}
9+
10+
# e.g.
11+
#echo $(get_latest_github_release data-mill-cloud/data-mill)

infrastructure/utils/get_os_type.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,16 @@ get_os_type() {
77
*) echo "?"
88
esac
99
}
10+
11+
get_pacman(){
12+
# one of these commands should always be available to install packages
13+
pacmans=( yum apt-get pacman )
14+
15+
for i in "${pacmans[@]}"
16+
do
17+
command -v $i > /dev/null 2>&1 && {
18+
echo $i
19+
break
20+
}
21+
done
22+
}

install.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
get_latest_github_release() {
44
# taken from https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c
5-
curl --silent "https://api.github.com/repos/$1/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")'
5+
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
6+
grep '"tag_name":' | # Get tag line
7+
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
68
}
79

810
latest_version=$(get_latest_github_release "data-mill-cloud/data-mill")

0 commit comments

Comments
 (0)