Windows批处理文件中的git grep和xargs? [英] git grep and xargs in Windows Batch file?
本文介绍了Windows批处理文件中的git grep和xargs?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试创建以下 .sh
脚本的Windows友好 .bat
实现.前几行都很好,只需添加 SET
,cd就可以了.git grep很好,但是 xargs
却不行.xargs 逻辑看起来像 .bat
吗?
I am trying to create a Windows friendly .bat
implementation of the following .sh
script. The top few lines are all fine, just add SET
and cd is fine. git grep is fine, however, xargs
isn't... What would the git grep | xargs
logic look like in .bat
?
INFINITY=10000
TOPDIR=$(pwd)
METEOR_DIR="./code"
cd "$METEOR_DIR"
# Call git grep to find all js files with the appropriate comment tags,
# and only then pass it to JSDoc which will parse the JS files.
# This is a whole lot faster than calling JSDoc recursively.
git grep -al "@summary" | xargs -L ${INFINITY} -t \
"$TOPDIR/node_modules/.bin/jsdoc" \
-t "$TOPDIR/jsdoc/docdata-jsdoc-template" \
-c "$TOPDIR/jsdoc/jsdoc-conf.json" \
2>&1 | grep -v 'WARNING: JSDoc does not currently handle'
推荐答案
最近的 Git forWindows版本包含200多个Linux命令.
Any recent Git for Windows release has more than 200 Linux commands packaged in it.
添加到您的PATH < path \ to \ Git \ usr \ bin
中,您将拥有 xargs
.
Add to your PATH <path\to\Git\usr\bin
and you will have xargs
.
vonc@VONCM D:\prgs\git\PortableGit-2.9.2-64-bit\usr\bin
> dir xargs.exe
Directory of D:\prgs\git\PortableGit-2.9.2-64-bit\usr\bin
20/01/2016 10:17 64 058 xargs.exe
这篇关于Windows批处理文件中的git grep和xargs?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文