From 12290c02374b481bb1864696a0bdd10d4382360d Mon Sep 17 00:00:00 2001 From: Mike Date: Wed, 24 Jan 2024 13:04:25 +0100 Subject: [PATCH] fix(get_nvim): use current commit when the repo is in detach HEAD --- bin/get_nvim.sh | 6 +++++- shell/alias/alias.sh | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/get_nvim.sh b/bin/get_nvim.sh index 4b2e7be..3e7a633 100755 --- a/bin/get_nvim.sh +++ b/bin/get_nvim.sh @@ -554,6 +554,10 @@ make clean BUILD_TYPE="Release" current_branch="$(git branch --show-current)" +if [[ -z "$current_branch" ]]; then + current_branch="$(git rev-parse HEAD)" +fi + if [[ $STABLE -eq 1 ]]; then BRANCH="${BRANCH:-$(git tag | sort -h | tail -1)}" elif [[ $DEV -eq 1 ]]; then @@ -563,7 +567,7 @@ else BRANCH="$current_branch" fi -if [[ $BRANCH != "$current_branch" ]]; then +if [[ $BRANCH != "$current_branch" ]]; then status_msg "Checking out to $BRANCH" git checkout "$BRANCH" fi diff --git a/shell/alias/alias.sh b/shell/alias/alias.sh index 99f4e8a..44b4cbe 100755 --- a/shell/alias/alias.sh +++ b/shell/alias/alias.sh @@ -83,6 +83,8 @@ if hash nvim 2>/dev/null; then alias bim="nvim" alias cim="nvim" alias im="nvim" + + # shellcheck disable=SC2016 export MANPAGER='nvim --clean --cmd "set fileencoding=utf-8" -u "$HOME/.config/nvim/man.lua" +Man!' # export MANPAGER='nvim --cmd "let g:minimal=v:true" +Man!'