summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorruki <[email protected]>2020-01-21 00:42:42 +0800
committerruki <[email protected]>2020-01-20 22:16:17 +0800
commitab317d02fb8442204813b5b66457406498e48c1c (patch)
tree3d21588850e41b8a613ac62d1e3f34e5c2e35687 /scripts
parentf07af69d4ed8474302ecd016ab5fec71a658c58f (diff)
add shallow-submodules for git
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/get.sh15
1 files changed, 3 insertions, 12 deletions
diff --git a/scripts/get.sh b/scripts/get.sh
index fa74379d9..fce123a23 100755
--- a/scripts/get.sh
+++ b/scripts/get.sh
@@ -98,7 +98,7 @@ install_tools()
}
test_tools || { install_tools && test_tools; } || my_exit "$(echo -e 'Dependencies Installation Fail\nThe getter currently only support these package managers\n\t* apt\n\t* yum\n\t* zypper\n\t* pacman\nPlease install following dependencies manually:\n\t* git\n\t* build essential like `make`, `gcc`, etc\n\t* libreadline-dev (readline-devel)\n\t* ccache (optional)')" 1
branch=master
-mirror=tboox
+mirror=xmake-io
IFS=':'
if [ x != "x$1" ]; then
brancharr=($1)
@@ -116,12 +116,12 @@ fi
projectdir=$tmpdir
if [ 'x__local__' != "x$branch" ]; 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')"
+ git clone --depth=50 -b "$branch" "https://github.com/$mirror/xmake.git" --recurse-submodules $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')"
+ git clone --depth=1 -b "$branch" "https://github.com/$mirror/xmake.git" --recurse-submodules --shallow-submodules $projectdir || my_exit "$(echo -e 'Clone Fail\nCheck your network or branch name')"
fi
else
if [ -d '.git' ]; then
@@ -167,34 +167,25 @@ install_profile()
echo '
if [[ "$SHELL" = */zsh ]]; then
# zsh parameter completion for xmake
-
_xmake_zsh_complete()
{
local completions=("$(XMAKE_SKIP_HISTORY=1 xmake lua --root private.utils.complete 0 nospace "$words")")
-
reply=( "${(ps:\n:)completions}" )
}
-
compctl -f -S "" -K _xmake_zsh_complete xmake
-
elif [[ "$SHELL" = */bash ]]; then
# bash parameter completion for xmake
-
_xmake_bash_complete()
{
local word=${COMP_WORDS[COMP_CWORD]}
-
local completions
completions="$(XMAKE_SKIP_HISTORY=1 xmake lua --root private.utils.complete "${COMP_POINT}" "conf" "${COMP_LINE}" 2>/dev/null)"
if [ $? -ne 0 ]; then
completions=""
fi
-
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
}
-
complete -o default -o nospace -F _xmake_bash_complete xmake
-
fi
' >> ~/.xmake/profile