sass --watch process is locking up my terminal window

前端 未结 1 865
不思量自难忘°
不思量自难忘° 2020-12-21 09:51

I\'m working on a shell script to optimize my build process on a web/front end project.

I\'m using sass to enhance css development and the html5boilerplate build scr

相关标签:
1条回答
  • 2020-12-21 10:20

    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 &
    

    edit -- expand on what is possible for monitoring

    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 &
    

    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
    

    To watch the current activity.

    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
    

    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.

    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 
    

    Crontabs are a little tricky. If you get to the point you feel you can use them, better to read the man page, other on-line help, and if you get stuck, then post on http://unix.stackexchange.com to get help.

    I hope this helps.

    0 讨论(0)
提交回复
热议问题