2016-07-30 26 views
1

Ich versuche, eine Windows-freundliche .bat Implementierung des folgenden .sh Skript zu erstellen. Die oberen paar Zeilen sind alle in Ordnung, fügen Sie einfach SET und CD ist in Ordnung. git grep ist in Ordnung, aber xargs ist nicht ... Was würde die git grep | xargs Logik in .bat aussehen?git grep und xargs in Windows Batch-Datei?

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' 

Antwort

2

Alle bisherigen Git for Windows release hat mehr als 200 Linux-Befehle in sie verpackt.

Fügen Sie Ihrem Pfad <path\to\Git\usr\bin hinzu und Sie werden xargs haben.

[email protected] 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 
+0

mentiert xargs Port auf einigen externen Bibliotheken abhängen, versuchen nativen xargs Port verwenden http://www.pirosa.co.uk/demo/wxargs/wxargs.html statt – user2956477

+0

@ user2956477 warum? Alle externen Bibliotheken sind Pakete mit Git für Windows. – VonC

+0

Es ist immer besser, single native binary ohne Abhängigkeit zu haben, minimiert es mögliche Probleme – user2956477