A command-line tool to update multiple project directories at once. It automatically detects the programming language of each project and executes bash commands according to the project programming language.
To use updatr you must provide a directory containing your projects and a configuration file, for example:
updatr --path="~/Personal/Projects" --config="~/path/to/config.toml"The config.toml file must contain the configuration(commands), for each programming language or project, that will be updated in that directory.
If no configuration file is found, updatr will not execute any commands to avoid unexpected behaviors.
You can install the tool using the following command:
go install github.com/tiagovaldrich/updatr@latestOr you can clone the repository and build the project.
make buildAnd then you can execute the updatr binary.
./updatr --path /path/to/projects --config /path/to/config.tomlupdatr --path /path/to/projects --config /path/to/config.toml--path: Path to the directory containing your projects (default: executable directory)--config: Path to the configuration file (default: config.toml in the executable directory)
Create a config.toml file with the commands to be executed for each programming language. Example:
[go]
commands = [
"git stash",
"git checkout master",
"git pull origin master",
"make install",
]
ignore_projects = ["project5", "project9"]
[nodejs]
commands = [
"git stash",
"git checkout master",
"git pull origin master",
"npm install",
]
ignore_projects = ["project1", "project2"]- The tool scans the provided directory for subdirectories
- For each subdirectory, it detects the programming language based on project files:
go.modfor Go projectspackage.jsonfor NodeJS projects
- Once detected, it executes the configured commands for that language in sequence
- If no configuration is found for a language, it won't run any command to avoid unexpected behaviors
Feel free to open issues and pull requests to add support for more programming languages or improve the existing functionality.
This project is open source and available under the MIT License.