diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2012-02-03 14:54:58 +0100 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2012-02-03 14:54:58 +0100 |
commit | d8a3b76e6044689ebe4336abbcd21f677dbba31d (patch) | |
tree | 0e142976ecc6a58a84624d8f0febdff6640069e4 | |
parent | d171c770c2cb885e1af9801bdeb3a7375a208a82 (diff) | |
download | vim4projects-d8a3b76e6044689ebe4336abbcd21f677dbba31d.tar.gz vim4projects-d8a3b76e6044689ebe4336abbcd21f677dbba31d.tar.xz vim4projects-d8a3b76e6044689ebe4336abbcd21f677dbba31d.zip |
init.sh: handle git submodules better
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rwxr-xr-x | init.sh | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -50,22 +50,19 @@ announce () { do_git_submodule () { # usage: $1=action ($1 passed from main), $2..$N=submodule(s) ret=0 - # TODO: pushd $GIT_ROOT + git_prefix=$(git rev-parse --show-prefix) for submodule in "${@:2}"; do announce "$1 $submodule (git submodule)" if [ "$1" == "get" ]; then - # TODO: avoid this workaround - if [ ! -f .gitmodules ]; then - submodule="$SUBMODULES_DIR/$submodule" - fi - git submodule update --init "$submodule" 2>&1 + pushd "$(git rev-parse --show-toplevel)" 2>/dev/null + git submodule update --init "${git_prefix}${submodule}" 2>&1 + popd 2>/dev/null else do_del "$submodule" fi ret=$? [ $ret -ne 0 ] && break done - # TODO: popd check_ret $ret } |