This repository was archived by the owner on Oct 21, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
get_latest_github_release () {
4
4
# 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/'
6
8
}
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() {
7
7
* ) echo " ?"
8
8
esac
9
9
}
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 2
2
3
3
get_latest_github_release () {
4
4
# 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
6
8
}
7
9
8
10
latest_version=$( get_latest_github_release " data-mill-cloud/data-mill" )
You can’t perform that action at this time.
0 commit comments