Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .rc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ GIT_SUBREPO_ROOT=$(
) || return
export GIT_SUBREPO_ROOT

export PATH=$GIT_SUBREPO_ROOT/lib:$PATH
export MANPATH=$GIT_SUBREPO_ROOT/man:$MANPATH
if ! [[ "$PATH" =~ "$GIT_SUBREPO_ROOT/lib:" ]]; then
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work because .rc isn't a bash file. As can be see in lines previous to this one it is used by many shells and =~ is a bash only operator. This needs to use posix shell commands to accomplish. I agree that this unconditionally updates your path, but you must be doing a lot of sourcing your bashrc before you would notice.

PATH="$GIT_SUBREPO_ROOT/lib:$PATH"
fi
export PATH

if ! [[ "$MANPATH" =~ "$GIT_SUBREPO_ROOT/man:" ]]; then
MANPATH="$GIT_SUBREPO_ROOT/man:$MANPATH"
fi
export MANPATH

source "$GIT_SUBREPO_ROOT/share/enable-completion.sh"