diff --git a/scripts/health-check.sh b/scripts/health-check.sh index 40a2ea7..65a0da1 100755 --- a/scripts/health-check.sh +++ b/scripts/health-check.sh @@ -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 diff --git a/scripts/utils.sh b/scripts/utils.sh index ea7f91d..eec7f1e 100755 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -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 +}