Skip to content

Instantly share code, notes, and snippets.

@andkirby
Last active April 22, 2016 06:59
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 andkirby/831aed85d166c6c93511c6856d8dc061 to your computer and use it in GitHub Desktop.
Save andkirby/831aed85d166c6c93511c6856d8dc061 to your computer and use it in GitHub Desktop.
Example of PS1 with condition.
#!/usr/bin/env bash
alias __ch_task='if [[ "" != $(git rev-parse --git-dir 2> /dev/null) ]]; then echo -n $(ch config task); fi;'
export PS1='$(__ch_task)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment