summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTitanSnow <[email protected]>2017-05-07 09:22:30 +0800
committerTitanSnow <[email protected]>2017-05-07 09:22:30 +0800
commitaccfa6b85702c4264b9b68cd3de78fbf4214d4be (patch)
tree3f4226a1e3662765808f699a7ff610745e09b6a3
parent33635da7673bdfa32c549f164c6c9db55d360a49 (diff)
add commit arg
-rwxr-xr-xscripts/get.sh8
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