Skip to content

Commit 2149f8c

Browse files
committed
feat(submodules): init if necessary
1 parent 51ae891 commit 2149f8c

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

git-prompt-kit.zsh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,17 @@ _git_prompt_kit_no_color() {
772772
}
773773

774774
_git_prompt_kit_init() {
775+
# if installed with Homebrew, will not have .gitmodules
776+
if [[ -f ${GIT_PROMPT_KIT_SOURCE_PATH}/.gitmodules && ! -f ${GIT_PROMPT_KIT_SOURCE_PATH}/gitstatus/gitstatus.plugin.zsh ]]; then
777+
'builtin' 'print' Finishing installing Git Prompt Kit.
778+
'command' 'git' submodule update --init --recursive &>/dev/null
779+
fi
780+
781+
if ! [[ -f ${GIT_PROMPT_KIT_SOURCE_PATH}/gitstatus/gitstatus.plugin.zsh ]]; then
782+
'builtin' 'print' There was problem finishing installing Git Prompt Kit.
783+
return
784+
fi
785+
775786
# Source local gitstatus
776787
# Second param is added to gitstatus function names as a suffix
777788
'builtin' 'source' ${GIT_PROMPT_KIT_SOURCE_PATH}/gitstatus/gitstatus.plugin.zsh $GIT_PROMPT_KIT_GITSTATUS_FUNCTIONS_SUFFIX

0 commit comments

Comments
 (0)