This repository was archived by the owner on Oct 21, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33get_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)
Original file line number Diff line number Diff 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+ }
Original file line number Diff line number Diff line change 22
33get_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
810latest_version=$( get_latest_github_release " data-mill-cloud/data-mill" )
You can’t perform that action at this time.
0 commit comments