【问题标题】:Fswatch with different extensions具有不同扩展名的 Fswatch
【发布时间】:2016-09-03 22:49:55
【问题描述】:

我需要查看具有不同扩展名的文件,并在每次更改后运行 .sh 命令。使用 fswatch,我已经能够单独观看每个扩展,例如:

fswatch *.html | (while read; do ./dev.sh; done) 

fswatch index-static/*.js | (while read; do ./dev.sh; done) 

fswatch index-static/*.scss | (while read; do ./dev.sh; done)

如果我在不同的终端窗口中运行这些命令,我​​会得到我想要的……在具有 (html|scss|js) 扩展名的文件发生更改后触发 .sh 命令。

但是,我无法将其整合到一个命令中。

这是在 MaxOS El Capitan 上运行的,如果您需要了解的话。

【问题讨论】:

    标签: regex bash fswatch


    【解决方案1】:

    我对@9​​87654322@没有直接经验,但根据usage,您可以一次提供多个路径,例如:

    fswatch *.html index-static/*.js index-static/*.scss | (while read; do ./dev.sh; done) 
    

    这对你有用吗?

    【讨论】:

    • 确实如此!我会发誓我以前试过这个……但显然事实并非如此。谢谢!
    • 太棒了!很高兴我能帮忙:)
    猜你喜欢
    • 1970-01-01
    • 2018-08-16
    • 2012-11-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-15
    • 2015-11-15
    • 1970-01-01
    相关资源
    最近更新 更多