https://github.com/marcbachmann/codemod
https://github.com/marcbachmann/codemod
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/marcbachmann/codemod
- Owner: marcbachmann
- Created: 2017-01-18T16:05:32.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T08:43:53.000Z (over 2 years ago)
- Last Synced: 2025-12-01T12:34:52.336Z (7 months ago)
- Language: JavaScript
- Size: 162 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# codemod - tooling
A small tool to automate pull requests and code changes
## Execute with a variable file
1. Set up the variables
- create a variable file named `variables.txt`, one directory per line
```
repos/livingdocs-server upfrontIO/livingdocs-server
repos/nzz-api nzzdev/livingdocs-api
repos/livingdocs-editor upfrontIO/livingdocs-editor
repos/nzz-editor nzzdev/livingdocs-editor
```
2. 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`
## Pipe dirs to ./eachdir
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
```
Usage: ./exec [-r] [-c]
-r don't use formatted output
-c use a 'bash -c' like syntax to execute commands & interpolate variables
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`
```
## Screenshot
![example][example]
[example]: docs/example.png