Skip to content

Commit eb30a6c

Browse files
author
Eric Crosson
committed
Initialize submodules before invoking post-clone hook
Allowing compatibility with captain-hook
1 parent c78e186 commit eb30a6c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

hooks/post-checkout

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ readonly repo=$(git rev-parse --show-toplevel)
1111

1212
main() {
1313
rm -rf -- "${repo}/.git/hooks"
14+
initializeSubmodules
1415
installClonedReposHooks
1516
invokeClonedReposPostCloneHook
1617
}
1718

19+
initializeSubmodules() {
20+
git submodule update --init --recursive
21+
}
22+
1823
installClonedReposHooks() {
1924
cd "${repo}/.git"
2025
rm -rf hooks
@@ -23,7 +28,7 @@ installClonedReposHooks() {
2328
}
2429

2530
invokeClonedReposPostCloneHook() {
26-
local -r post_clone_hook=${repo}/.git/hooks/post-clone
31+
local -r post_clone_hook="${repo}/.git/hooks/post-clone"
2732
test ! -e "${post_clone_hook}" && return
2833
chmod u+x "${post_clone_hook}"
2934
${post_clone_hook}

0 commit comments

Comments
 (0)