Skip to content

Commit

Permalink
Use ERB template vars in PS1 prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
jhunt committed Apr 14, 2016
1 parent 5e2f48b commit 5cc31ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ci/release_notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Bug Fixes

- Use ERB template variables in Toolbelt prompt
4 changes: 2 additions & 2 deletions jobs/toolbelt/templates/envrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ for package in $(find /var/vcap/packages -type l -name 'toolbelt-*'); do
done

if [[ "${UID}" -eq 0 ]]; then
export PS1=$(echo '==[]=[ \[\e[1;33m\t\e[0m\] ]=[ \[\e[1;34m\]toolbelt-warden\[\e[0m\] \[\e[1;32m\]toolbelt/0\[\e[0m\] ]=[ \[\e[1;34m\]\w\[\e[0m\] ]=[]==\n\[\e[1;31m\]\$ \[\e[0m\]')
export PS1=$(echo '==[]=[ \[\e[1;33m\t\e[0m\] ]=[ \[\e[1;34m\]<%= spec.deployment %>\[\e[0m\] \[\e[1;32m\]<%= spec.job.name %>/<%= spec.index %>/\[\e[0m\] ]=[ \[\e[1;34m\]\w\[\e[0m\] ]=[]==\n\[\e[1;31m\]\$ \[\e[0m\]')
else
export PS1=$(echo '==[]=[ \[\e[1;33m\t\e[0m\] ]=[ \[\e[1;34m\]toolbelt-warden\[\e[0m\] \[\e[1;32m\]toolbelt/0\[\e[0m\] ]=[ \[\e[1;34m\]\w\[\e[0m\] ]=[]==\n\[\e[1;34m\]\$ \[\e[0m\]')
export PS1=$(echo '==[]=[ \[\e[1;33m\t\e[0m\] ]=[ \[\e[1;34m\]<%= spec.deployment %>\[\e[0m\] \[\e[1;32m\]<%= spec.job.name %>/<%= spec.index %>/\[\e[0m\] ]=[ \[\e[1;34m\]\w\[\e[0m\] ]=[]==\n\[\e[1;34m\]\$ \[\e[0m\]')
fi

<%= p('toolbelt.envrc') %>

0 comments on commit 5cc31ed

Please sign in to comment.