我记得,有一篇文章,或几篇文章围绕作者如何根据SSH地址从绿色(发展)到红(生产)改变终点站的颜色。
But I am not sure how to replicate that with Heroku console.
理想的情况是,我要说的是蓝色,当时我是heroku console-remoteing
,然后是红色的,当时我是heroku console -remote production
。
是否有任何建议?
我记得,有一篇文章,或几篇文章围绕作者如何根据SSH地址从绿色(发展)到红(生产)改变终点站的颜色。
But I am not sure how to replicate that with Heroku console.
理想的情况是,我要说的是蓝色,当时我是heroku console-remoteing
,然后是红色的,当时我是heroku console -remote production
。
是否有任何建议?
在作为生产环境一部分装上的任何档案中(例如,config/environments/production.rb
),你可以提出:
if defined? IRB
# whew!
conf = IRB.conf[:PROMPT][IRB.conf[:PROMPT_MODE]]
red = " 33[0;31m"
reset = " 33[0m"
conf[:PROMPT_S] = "#{red}>> #{reset}" # regular prompt
end
The crazy escape characters are ANSI color codes. The " 33"
is an escape character, and the rest is a code for a particular color or effect. You can find a list of other colors and effects here. That IRB.conf hash is a global conf for IRB. You may want to set a few other keys on it - they re documented here.
如果你不使用铁路(因此不一定有环境档案),那么你总是可以通过使用
我通过使用Marco Polo gem 。
然后,你可以迅速改变你的 con子,确定 her湖的conf状。 你可以利用逃脱法来改变肤色。 在我的案件中,我确定,这种生产在五大背景(难以误导)下,利用这种控制顺序进行白化,以达到《防污公约》的价值。
[ESC][105;97;1mPRODUCTION[ESC][0m
不幸的是,Stack Overflow赢得了帽子,让我揭开越狱本身。 你们不得不使用“灯塔”++,并用X1B取代“ESC”。 之后,你可以复制并贴出在Heroku console的MARCO_POLO_APP_NAME的价值。 我无法将其置于指挥线。
untested, but something along the lines of this in your .bashrc or whatever may be what you want (it s not completely safe but you should get the idea)
function heroku {
REMOTE_TERMINAL_THEME_NAME="Solarized Light"
CURTAB=$(osascript -e "tell application "Terminal" to get the selected tab of the front window")
CURTHEME=$(osascript -e "tell application "Terminal" to get the name of current settings of the selected tab of the front window")
HEROKU=$(which heroku)
osascript -e "tell application "Terminal" to set current settings of $CURTAB to settings set "$REMOTE_TERMINAL_THEME_NAME""
$HEROKU "$@"
osascript -e "tell application "Terminal" to set current settings of $CURTAB to settings set "$CURTHEME""
}
我把它用于sh,但从概念上说是一样的:凌驾于你的指挥,其职能是使用撒布特来改变终端环境,然后将其撤回。 基于论点的转换应当比较容易增加。
在我看来,当你把 alia子打成 alia子或bat子时,你可以将其自动化。 有一个条款,即简单的对应指挥可以改变你的肤色,直到你再回来。
因此,如果您的一位六位用户,你可以与你一道这样做。
#pretend this is a bunch of prompt setup
#USER ALIASES
alias heroku-staging="export PS1="e[0;34m[Heroku Staging]$]" && heroku console --remote staging"
然后,仅打上 her湖。
I m attempting to write a bash script to parse out the following log file and give me a list of CURRENT players in the room (so ignoring players that left, but including players that may have rejoined)...
How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks
I like to write bash shell scripts on my iPhone, put them in an app folder with an icon, plist, etc., so they execute like apps by tapping their icon on SpringBoard. This is not interactive like ...
From a programming standpoint, when you set the bash shell to use vi or emacs via set -o vi or set -o emacs What is actually going on here? I ve been reading a book where it claims the bash shell ...
I am construcing a command in bash dynamically. This works fine: COMMAND="java myclass" ${COMMAND} Now I want to dynamically construct a command that redirectes the output: LOG=">> myfile.log ...
I want perform sha1sum file1 and sha1sum file2 and perform bitwise OR operation with them using bash. Output should be printable i.e 53a23bc2e24d039 ... (160 bit) How can I do this? I know echo $(( ...
I m 试图撰写一个双面文字,处理一个文件清单,其名字在投入档案中每栏一栏储存,就像一个一样。
Is it possible to set the Screen Title using a shell script? I thought about something like sending the key commands ctrl+A shift-A Name enter I searched for about an hour on how to emulate ...