add submodules initialization to health-check

This commit is contained in:
Jorge Morante 2017-10-06 18:49:58 +02:00
parent 7221bf8bea
commit 7735ef927b
2 changed files with 29 additions and 0 deletions

View File

@ -149,6 +149,15 @@ function perform_health_check() {
healthy=0
fi
if [[ $(is_dir_empty "$CURRENT_DIR/../vendor/tmux-printer") == "1" ]]; then
log_message " * Submodules not initialized properly. Please run:"
log_message ""
log_message " cd $TMUX_FINGERS_ROOT"
log_message " git submodule update --init --recursive"
log_message " tmux source ~/.tmux.conf"
healthy=0
fi
if [[ $healthy -eq 0 ]]; then
while [[ $(is_tmux_ready) = 0 ]]; do
: # waiting for-tmux

View File

@ -117,3 +117,23 @@ function tmux_list_vi_copy_keys() {
echo "$output"
}
function is_dir_empty() {
local dir_path="$1"
if [[ $(ls -1 "$dir_path" | wc -l) -gt 0 ]]; then
echo 0
else
echo 1
fi
}
function resolve_path() {
local path=$1
if [[ "$OSTYPE" == "darwin"* ]]; then
echo "$(stat -f "%N" "$path")"
else
echo "$(readlink -f "$path")"
fi
}