我正在尝试find为所有JavaScript文件运行命令,但如何排除特定目录?
这是find我们正在使用的代码.
for file in $(find . -name '*.js')
do 
  java -jar config/yuicompressor-2.4.2.jar --type js $file -o $file
done
我目前正在使用 travis ci 在补丁进入 github 时检查补丁,并试图找出 clang-format 3.9(因为 travis ci 目前仅支持最新的 ubuntu 14.04)以在扫描时忽略整个目录或文件变化。
我的 .travis.yml 文件:
language: c++
sudo: required
dist: trusty
install:
- sudo apt-get update
- sudo apt-get install clang-format-3.9 python3
- ./travisci/check_patch.py
我的 travisci/check_patch.py 文件:
#!/usr/bin/env python3
from subprocess import Popen, PIPE, STDOUT
# Run clang to check if code changes cause a diff output and return 1 if so.
cmd = "git show origin/master..@ | clang-format-diff-3.9 -p 1 -style=file"
diff = Popen(cmd, stdout=PIPE, shell=True).communicate()[0]
if diff: …