From accfa6b85702c4264b9b68cd3de78fbf4214d4be Mon Sep 17 00:00:00 2001 From: TitanSnow Date: Sun, 7 May 2017 09:22:30 +0800 Subject: add commit arg --- scripts/get.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/get.sh b/scripts/get.sh index 94b616ce7..e25480675 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -1,7 +1,7 @@ #!/bin/bash # xmake getter -# usage: bash <(curl -s ) [branch] +# usage: bash <(curl -s ) [branch] [commit] # print a LOGO! echo ' _ ' @@ -62,6 +62,12 @@ fi if [ 'x-b __local__' != "x$branch" ] then git clone --depth=1 $branch https://github.com/tboox/xmake.git /tmp/$$xmake_getter || my_exit 'Clone Fail' + if [ x != "x$2" ] + then + cd /tmp/$$xmake_getter || my_exit 'Chdir Error' + git checkout -qf "$2" + cd - + fi else cp -r "$(git rev-parse --show-toplevel 2>/dev/null || hg root 2>/dev/null || echo "$PWD")" /tmp/$$xmake_getter || my_exit 'Clone Fail' fi -- cgit v1.3.1