【发布时间】:2019-04-19 11:02:19
【问题描述】:
我有一个文件 source-push.sh,它返回我想从 find 命令的结果中排除的文件列表。
看起来像这样:
#!/usr/bin/env bash
find . -not \( -path './node_modules' -prune \) -name '*.js' | grep -vE $(echo $(./source-push.sh | xargs -I{} echo -n "{}|") | rev | cut -b2- | rev) | xargs -L1 standard --fix
find . -not \( -path './node_modules' -prune \) -name '*.css' | grep -vE $(echo $(./source-push.sh | xargs -I{} echo -n "{}|") | rev | cut -b2- | rev) | xargs -L1 stylelint --config stylelint.json
应该有比这更好的方法来完成这项工作。有什么建议吗?
【问题讨论】: