我特别想在 2 个子目录中同时查看 2 个不同的文件类型:
'js' 子目录
中的 .coffee 文件类型 'css' 子目录中的 .styl 文件类型
我只知道这么多 bash,我正试图让这样的东西发挥作用
while inotifywait --format %w%f ./{css,js}/*.{styl,coffee}; do
# regex pattern to match the file ending
# and define it to $ending
if[ $ending == coffee ]
then
coffee -c $file
elif[ $ending == styl ]
then
stylus -c $file
fi
done
// 编辑 // 修改了这一行:
while inotifywait --format %w%f ./{css,js}/*.{styl,coffee}; do
所以现在它会检查这两个文件,但如果 css 文件夹中没有 .coffee 文件,或者 js 中没有 .styl 文件,它会返回未找到文件的错误。
另外我注意到当我运行这个脚本时,它返回/运行以下 3 次
Setting up watches.
Watches established.
./css/styles.styl