diff options
| author | TitanSnow <[email protected]> | 2017-05-07 09:22:30 +0800 |
|---|---|---|
| committer | TitanSnow <[email protected]> | 2017-05-07 09:22:30 +0800 |
| commit | accfa6b85702c4264b9b68cd3de78fbf4214d4be (patch) | |
| tree | 3f4226a1e3662765808f699a7ff610745e09b6a3 /scripts | |
| parent | 33635da7673bdfa32c549f164c6c9db55d360a49 (diff) | |
add commit arg
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/get.sh | 8 |
1 files changed, 7 insertions, 1 deletions
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 <my location>) [branch] +# usage: bash <(curl -s <my location>) [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 |
