@@ -13,13 +13,28 @@ args=()
1313unstable=
1414userinstall=
1515userinstall2=
16+ commit=
1617
1718for arg in " $@ " ; do
1819 case " $arg " in
1920 --unstable) unstable=1; ;;
2021 --repo=* ) arkstGithubRepo=" ${arg# --repo=} " ; ;;
2122 --perform-user-install) userinstall2=yes; ;;
2223 --yes-i-really-want-to-perform-a-user-install) userinstall=yes; ;;
24+ --commit=* ) commit=" ${arg# --commit=} " ; ;;
25+ --tag=* )
26+ tagname=" ${arg# --tag=} "
27+ commit=" $( curl -s " https://api.github.com/repos/${arkstGithubRepo} /git/refs/tags/${tagname} " | sed -n ' s/^ *"sha": "\(.*\)",.*/\1/p' ) "
28+ if [ -z " $commit " ]; then
29+ echo " Tag ${tagname} not found"
30+ exit 1
31+ elif [ " $( echo " $commit " | wc -l) " -ne 1 ]; then
32+ echo " Tag ${tagname} is matched more than one tag."
33+ curl -s " https://api.github.com/repos/${arkstGithubRepo} /git/refs/tags/${tagname} " | sed -n ' s/^ *"ref": "refs\/tags\/\(.*\)",.*/\1/p'
34+ exit 1
35+ fi
36+ echo " Tag ${tagname} found at commit ${commit} "
37+ ;;
2338 * )
2439 if [[ -n " $channel " || " $arg " == --* ]]; then
2540 args+=(" $arg " )
@@ -128,7 +143,9 @@ function doInstallFromBranch(){
128143# Download and untar installation files
129144cd " $TEMP " || die " Unable to change to temporary directory"
130145
131- if [ " $channel " = " master" ] && [ -z " $unstable " ]; then
146+ if [ -n " $commit " ]; then
147+ doInstallFromCommit " $commit " " ${args[@]} "
148+ elif [ " $channel " = " master" ] && [ -z " $unstable " ]; then
132149 doInstallFromRelease " ${args[@]} "
133150else
134151 doInstallFromBranch " $channel " " ${args[@]} "
0 commit comments