Join Slack
Powered by
Hi, I want to execute a git command in all directo...
# scripting
l
Luke
09/27/2018, 7:07 PM
Hi, I want to execute a git command in all directories inside a certain folder, but I can't find how to navigate in the directory to execute the command.
n
Nikky
09/27/2018, 7:13 PM
this may help:
https://stackoverflow.com/a/41495542/9006779
Nikky
09/27/2018, 7:14 PM
all you need to adjust is the FIle passed to workingDir
Nikky
09/27/2018, 7:14 PM
and maybe make it a extension function on Array<String> so oyu have better control over arguments
Nikky
09/27/2018, 7:16 PM
apart from that i suspect the normally executing commands will probably run them in
user.dir
or maybe some other system property that you could override
Nikky
09/27/2018, 7:17 PM
there is also this:
https://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html#exec(java.lang.String,%20java.lang.String[],%20java.io.File)
l
Luke
09/27/2018, 7:51 PM
Ok thanks, I'll check it out when I got time
Open in Slack
Previous
Next