4
내가 특별히 동시에 2 개 하위 디렉토리에 2 개 개의 다른 파일 형식을 볼려고 수정 다음 'JS'하위 디렉토리에inotifywait를 파일 유형에 따라 명령을 실행하려면
.coffee 파일 형식
.styl 파일 형식 'CSS'하위 디렉토리에
는 난 단지 너무 많은 떠들썩한 파티를 알고 난
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
,369를 작동하려면 이렇게 뭔가를 얻으려고
// 편집 // 이 줄을 수정 :
while inotifywait --format %w%f ./{css,js}/*.{styl,coffee}; do
그래서 지금은 모두 파일을 검사하지만, JS에는 CSS의 폴더에 .coffee 파일 또는 .styl 파일이 존재하지 않는 경우는, 그것이를 반환 파일을 찾을 수 없습니다.
는 또한 나는이 스크립트를 실행할 때, 그것은 반환/다음 3 회Setting up watches.
Watches established.
./css/styles.styl
inotifywait는 POSIX 확장 정규 표현식을 사용하며 제한적입니다 : http://stackoverflow.com/questions/7943528/inotifywait-exclude-regex-pattern-formatti ng이 스크립트들을 분리하십시오. 하나는 커피/js 당 하나는 하나의 스타일/css 당 하나입니다. –