diff options
| author | ruki <[email protected]> | 2019-06-27 00:42:31 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-06-26 22:15:09 +0800 |
| commit | 9f73278f8f7631bc53daba27ffdf84d96068c562 (patch) | |
| tree | 30fa1f498f2708a559440854fafc04295f13b5dd | |
| parent | 78aff8d5199448d604c8e9456063f9550d00c6b6 (diff) | |
fix get.sh and improve update
| -rwxr-xr-x | scripts/get.sh | 12 | ||||
| -rw-r--r-- | xmake/actions/update/main.lua | 6 |
2 files changed, 8 insertions, 10 deletions
diff --git a/scripts/get.sh b/scripts/get.sh index e89afea97..c9cdaff3e 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -46,11 +46,6 @@ echo ' > < | \__/ | /_| | < ___/ ' echo ' /_/\_\_|_| |_|\__ \|_|\_\____| getter ' echo ' ' -if [ 'x__local__' != "x$1" ] -then - brew --version >/dev/null 2>&1 && brew install --HEAD xmake && xmake --version && exit -fi - my_exit(){ rv=$? if [ "x$1" != x ] @@ -107,12 +102,13 @@ fi projectdir=$tmpdir if [ 'x__local__' != "x$branch" ] then - git clone --depth=50 -b "$branch" "https://github.com/$mirror/xmake.git" $projectdir || my_exit "$(echo -e 'Clone Fail\nCheck your network or branch name')" - if [ x != "x$2" ] - then + if [ x != "x$2" ]; then + git clone --depth=50 -b "$branch" "https://github.com/$mirror/xmake.git" --recursive $projectdir || my_exit "$(echo -e 'Clone Fail\nCheck your network or branch name')" cd $projectdir || my_exit 'Chdir Error' git checkout -qf "$2" cd - || my_exit 'Chdir Error' + else + git clone --depth=1 -b "$branch" "https://github.com/$mirror/xmake.git" --recursive $projectdir || my_exit "$(echo -e 'Clone Fail\nCheck your network or branch name')" fi else projectdir=`pwd` diff --git a/xmake/actions/update/main.lua b/xmake/actions/update/main.lua index 0de44628d..b30ba0799 100644 --- a/xmake/actions/update/main.lua +++ b/xmake/actions/update/main.lua @@ -320,9 +320,11 @@ function main() if version:find('.', 1, true) then git.clone(url, {outputdir = sourcedir}) git.checkout(version, {repodir = sourcedir}) - submodule.update({repodir = sourcedir, init = true, recursive = true}) + if not script_only then + submodule.update({repodir = sourcedir, init = true, recursive = true}) + end else - git.clone(url, {depth = 1, recursive = true, branch = version, outputdir = sourcedir}) + git.clone(url, {depth = 1, recursive = not script_only, branch = version, outputdir = sourcedir}) end end return true |
