Created
January 10, 2015 22:55
-
-
Save Laeeth/e7a7f0de471a3c7a7eca to your computer and use it in GitHub Desktop.
remove cached git files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module gitrmcache; | |
import std.stdio; | |
import std.file; | |
import std.process; | |
int main(string[] args) | |
{ | |
if (!((args.length==2) || (args.length==3))) | |
{ | |
writefln("syntax is gitrmcache <path> [filespec]"); | |
return 0; | |
} | |
if (args.length==3) | |
{ | |
foreach(item;dirEntries(args[1],args[2],SpanMode.breadth)) | |
{ | |
auto callgit=execute(["git","rm","--cached",item]); | |
} | |
} | |
else | |
{ | |
foreach(item;dirEntries(args[1],SpanMode.breadth)) | |
{ | |
auto callgit=execute(["git","rm","--cached",item]); | |
} | |
} | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment