Created
February 11, 2011 19:03
-
-
Save gilles/822828 to your computer and use it in GitHub Desktop.
Change the PS1 on your provisioned machines (chef)
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
# /etc/profile.d/prompt.sh | |
# Chef managed | |
extra="" | |
<%- @color ||= '' %> | |
if type rvm-prompt >/dev/null 2>&1; then | |
extra+="\[\e[1;36m\](\$(rvm-prompt i v g)) " | |
fi | |
export PS1="<%= @color %>[\u@\h] \[\e[1;35m\]\w\[\e[0m\] $extra\[\e[0m\]\$ " |
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
#my own PS1 with a RED date on prod, YELLOW on staging | |
case node[:app_environment] | |
when 'production' then color = '\[\e[0;31m\]' | |
when 'staging' then color = '\[\e[0;33m\]' | |
else color = '' | |
end | |
template "/etc/profile.d/prompt.sh" do | |
source "prompt.sh.erb" | |
mode "0644" | |
owner "root" | |
group "root" | |
backup 0 | |
variables( | |
:color => color | |
) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment