【问题标题】:Sublime build code崇高的构建代码
【发布时间】:2016-04-29 15:28:25
【问题描述】:
有人可以逐步解释以下构建脚本的工作原理吗?
{
"cmd": ["gnome-terminal -e 'bash -c \"python3 -i -u $file;bash\"'"],
"shell": true
}
我知道-i 做了什么(保持解释器打开),最后一个bash 保持终端打开,但其余的对我来说是不可思议的。特别是-e、-c 和-u 做了什么,它们被称为“标志”吗?我在哪里可以了解更多关于它们的信息?哪些部分是 Sublime 特有的,哪些与操作系统有关?
【问题讨论】:
标签:
bash
ubuntu
sublimetext3
【解决方案1】:
"gnome-terminal # use this terminal to run the next commands
-e # execute the following command
'
bash -c # read commands from the following string
\"
python3
-i # looks like interactive mode (sorry not a python dev)
-u # force stdin, stdout and stderr to be totally unbuffered
$file; # tipically this would be a python script, so you
# would end up being able to inspect the environment,
# calling functions, seeing their otputs, etc
bash # open a new shell
\"
'
"
我认为唯一可能成为 Sublime 一部分的部分是 $file,但这取决于代码,如果有更多上下文,我可能会给出更好的答案。