Skip to content

Commit

Permalink
fix(get_nvim): use current commit when the repo is in detach HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
mike325 committed Jan 24, 2024
1 parent 27cb6ff commit 12290c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bin/get_nvim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions shell/alias/alias.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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!'

Expand Down

0 comments on commit 12290c0

Please sign in to comment.