Skip to content

Commit

Permalink
fix(user): source user bashrc after platform (automotiveMastermind#18)
Browse files Browse the repository at this point in the history
* test for user/variables before platform eval
* test for user/bashrc after platform eval

This is useful for scenarios where the platform eval updates the PATH
variable that user bashrc may depend on. One example would be adding
additional completions to bash for a command installed in GOBIN.
  • Loading branch information
dmccaffery committed Jun 17, 2019
1 parent 9cd05f1 commit aa8ac25
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ export AM_PROMPT="$AM_HOME/prompt"
# add scripts to path
export PATH="$AM_PROMPT/scripts:$PATH"

# source user files
for USER_SCRIPT in $AM_PROMPT/user/*; do
source "$USER_SCRIPT"
done
# test for user variables
if [ -f $AM_PROMPT/user/variables ]; then
source "$AM_PROMPT/user/variables"
fi

# test for prompt bin
if [ -d "$AM_PROMPT/user/bin" ]; then
Expand All @@ -91,6 +91,11 @@ for EVAL_SCRIPT in $AM_PROMPT/scripts/eval/*; do
source "$EVAL_SCRIPT"
done

# test for user bashrc
if [ -f $AM_PROMPT/user/bashrc ]; then
source "$AM_PROMPT/user/bashrc"
fi

# aliases
# -- prompt for overwrites
alias cp='cp -i'
Expand Down

0 comments on commit aa8ac25

Please sign in to comment.