Last active
March 9, 2022 09:43
-
-
Save NoelDeMartin/06878d927fc02fdf3cd51d1e37f7d4d2 to your computer and use it in GitHub Desktop.
Bash settings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# VSCode opens terminals in the project root, so this will make sure that | |
# you're using the correct version of npm and node | |
if [ -f .nvmrc ]; then | |
nvm install &> /dev/null | |
fi | |
# Change default prompt | |
PROMPT_COMMAND=__prompt_command | |
__prompt_command() { | |
local exitcode=$? | |
local command=`history | tail -1 | cut -c 8-` | |
if [[ $exitcode == 0 ]] || \ | |
# 130 - Ignore manual interruption | |
[[ $exitcode == 130 ]] || \ | |
# 141 - Ignore exiting `git log` command (aliased as "gl") | |
[[ $exitcode == 141 && $command == "gl" ]] | |
then | |
PS1="🤖 " | |
else | |
PS1="💥 " | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I moved this to a repo with other settings I use: https://github.com/NoelDeMartin/env