相关疑难解决方法(0)

如何在find中排除目录.命令

我正在尝试find为所有JavaScript文件运行命令,但如何排除特定目录?

这是find我们正在使用的代码.

for file in $(find . -name '*.js')
do 
  java -jar config/yuicompressor-2.4.2.jar --type js $file -o $file
done
Run Code Online (Sandbox Code Playgroud)

linux shell find

1250
推荐指数
26
解决办法
92万
查看次数

How to ignore files or directories with clang-format 3.9

我目前正在使用 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
Run Code Online (Sandbox Code Playgroud)

我的 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: …
Run Code Online (Sandbox Code Playgroud)

clang travis-ci clang-format

9
推荐指数
2
解决办法
7290
查看次数

标签 统计

clang ×1

clang-format ×1

find ×1

linux ×1

shell ×1

travis-ci ×1