上海社会科学院--watch过程是我的终端窗口锁定 [英] sass --watch process is locking up my terminal window
问题描述
我工作的一个shell脚本来优化网络/前端的项目我的构建过程。
I'm working on a shell script to optimize my build process on a web/front end project.
我使用的是青菜,增强CSS发展和html5boilerplate构建脚本,以优化发展。
I'm using sass to enhance css development and the html5boilerplate build script to optimize for development.
我想拿到剧本做到以下几点。
1.检查青菜--watch已启用,如果没有运行。
I'm trying to get the script to do the following. 1. check if sass --watch is enabled, if not run
sass --watch file.scss:file.css
2。 cd到build文件夹,然后运行Ant构建
2. cd into the build folder and run ant build
问题是,青菜--watch锁定了终端和脚本将不会踏进Ant构建直到我按下Control-C停止SASS。
The problem is that sass --watch locks up the terminal and the script won't step into the ant build until I hit Control-C to stop sass.
我试过'的xterm'产卵SASS为新的终端窗口,但xterm的打开X-11的应用程序在我的Mac并没有什么火。
I've tried 'xterm' to spawn a new terminal window for sass, but xterm opens the X-11 app on my mac and nothing fires.
有另一种方式来打开一个终端窗口?是否有线程SASS的方法吗?我真的想运行我的脚本,并回到命令提示符,所以我可以重复我的命令,整天守在构建过程的平稳运行。
Is there another way to open a terminal window? Is there a way to thread sass? I really want to run my script and get back to a command prompt so I can repeat my command all day and keep the build process running smoothly.
推荐答案
这是在Unix / Linux环境下?然后尝试通过附加的后台运行你的SASS命令'和;' (运行在后台)字符。
即。
This is under a Unix/Linux environment? Then try running your sass command in the background by appending the '&' (run-in-background) char. I.E.
sass --watch file.scss:file.css &
编辑 - 扩大什么是可能用于监测
一个新的水平将是使这个独立在那里开始的。
The next level would be to make this independent of where it is started.
nohup sass --watch file.scss:file.css > ${logDir}/$(/bin/date +%Y%m%d.%H%M).sass_watch.log 2>&1 &
您可以启动上海社会科学院--watch
并关闭窗口,它将继续运行。
后来,如果你需要检查进度,可以使用
You can start sass --watch
and close the window, it will keep running.
Later on, if you need to check progress, you can use
tail -f ${logDir}/$(/bin/date +%Y%m%d.%H%M).sass_watch.log
要观看当前活动。
如果您怀疑事情发生了一段时间后,你可以指定行的#中包括向后滚动,即
If you suspect something happened a while back, you can specify the # of lines to include in the 'scroll back', i.e.
tail -1000 -f ${logDir}/$(/bin/date +%Y%m%d.%H%M).sass_watch.log
最后,如果你的青菜--watch支持某种形式的时间带(运行24小时,例如停止后),你可以做一个crontab条目,所以你总是有--watch运行,并且可以随时显示你经理当系统发现的到底是什么/。
Finally, you if your sass --watch supports some sort of time banding (stop after running 24 hrs, for example), you could make a crontab entry so you always have the --watch running AND you can always show your manager exactly what/when the system found.
编辑crontab中,添加条目
edit crontab, add entry
01 00 * * * { sass --watch --time 24hrs file.scss:file.css ; } > ${logDir}/$(/bin/date +%Y%m%d.%H%M).sass_watch.log 2>&1
的crontab是有点棘手。如果你到你觉得你可以使用它们的点,更好的阅读手册页,其他在线帮助,如果您遇到问题,然后张贴上的 http://unix.stackexchange.com 以获得帮助。
我希望这有助于。
这篇关于上海社会科学院--watch过程是我的终端窗口锁定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!