Installation
Using homebrew
Using cargo
or with cargo-binstall
Usage
All the configuration is done in a braise.toml file at the root of your project.
[!NOTE] Valid file names are defined here
[]
= "echo Hello, World!"
Then you can run your task with:
The following options are available:
# Global configuration
= "sh -c" # The shell to use (default: $SHELL or "sh -c")
= false # Do not print the command output (default: false)
= "NAME" # The default task to run (optional)
= ".env" # The path to the .env file (optional)
# Task configuration
[]
= "echo Hello, World!" # The command to run
= "A simple task" # The description of the task (optional)
= ["OTHER_TASK"] # The list of tasks to run before this one (optional)
= ["linux", "macos"] # The platforms on which the task can run (optional)
The shell and quiet fields are global and can be overridden for each task.
[!NOTE] If you are a busy person, you can use the
bralias instead ofbraise
Environment variables
By default braisé will look for a .env file at the root of your project and load the environment variables from it.
# .env
HELLO=WORLD
[]
= "echo $HELLO" # This will let the shell grab the environment variable
# or
= "echo {env(HELLO)}" # This will expand to "echo WORLD"
Default values for environment variables can also be set:
[]
= "echo {env(MISSING:default)}" # This will expand to "echo default"
Platform specific commands
You can specify platform specific commands by using the runs-on field:
[[]]
= "echo Hello, World!"
= ["windows"]
[[]]
= "echo Bonjour, Monde!"
= ["linux", "macos"]
Notice the double brackets [[NAME]] to define multiple tasks with the same name.
JSON Schema
A JSON schema is available here to help you write your braise.toml file.
#:schema https://raw.githubusercontent.com/cestef/braise/main/schema/braise.schema.json
[]
= "echo Hello, World!"
You can use the #:schema directive to specify the path to the schema file.
License
This project is licensed under the MIT license (You can basically do whatever you want with this code)