A small tool to automate pull requests and code changes
- Set up the variables
-
create a variable file named
variables.txt
, one directory per linerepos/livingdocs-server upfrontIO/livingdocs-server repos/nzz-api nzzdev/livingdocs-api repos/livingdocs-editor upfrontIO/livingdocs-editor repos/nzz-editor nzzdev/livingdocs-editor
- execute a command using
-
./execdir git status
-
or
./execdir -c hub clone $VAR1 .
-
you can use any space separated variable, just postfix
$VAR
with the index (zero based index) on a specific line -
have fun with the command aliases in
./run
-
Instead of creating a variables file, you can also pipe variables to the command.
$ find repos/* -d | ./eachdir -r pwd
/Users/marcbachmann/Development/upfrontIO/codemod/repos/livingdocs-editor
/Users/marcbachmann/Development/upfrontIO/codemod/repos/livingdocs-server
/Users/marcbachmann/Development/upfrontIO/codemod/repos/nzz-api
/Users/marcbachmann/Development/upfrontIO/codemod/repos/nzz-editor
Usage: ./exec [-r] [-c] <command>
-r don't use formatted output
-c use a 'bash -c' like syntax to execute commands & interpolate variables
<command> the command to execute in the directory
The absolute path to the directory is available as `$DIR`.
The current working directory is available as `$ROOT`
![example][example] [example]: docs/example.png