Skip to content

Instantly share code, notes, and snippets.

@soveran

soveran/ps1.sh Secret

Created April 13, 2012 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soveran/da4cd5674373e7f6042a to your computer and use it in GitHub Desktop.
Save soveran/da4cd5674373e7f6042a to your computer and use it in GitHub Desktop.
Display the current gemset in your prompt.
# The important bit in this short example
# is the call to the _gemset function.
export PS1='$(_gemset)\w \$ '
# This function checks if the GS_NAME variable
# has a value and returns either an empty string
# or the name of the current gemset.
_gemset() {
if [[ -z $GS_NAME ]]; then
echo ""
else
echo "$GS_NAME "
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment