cargo-run 0.1.0

A CLI tool to run custom scripts in Rust, defined in Scripts.toml
Documentation

cargo-run

crates.io Documentation Documentation Version MIT or Apache 2.0 licensed Dependency Status Download

A CLI tool to run custom scripts in Rust, defined in Scripts.toml.

Features

  • Run scripts defined in Scripts.toml.
  • Specify interpreters for scripts (e.g., bash, zsh, PowerShell).
  • Initialize a Scripts.toml file with default content.
  • Chain multiple scripts together using the include feature.

Installation

To install cargo-run, use the following command:

cargo install cargo-run

Usage

To run a script, use the following command:

cargo-script <option> <script_name>

Or

cgs <option> <script_name>

Complete script:

cgs run <script_name>

// Or

cargo-script run <script_name>

Scripts Examples

The Scripts.toml file is used to define scripts. The file is located in the root of the project directory. The following is an example of a Scripts.toml file:

[scripts]
# run a shell script
run_shell = "./.scripts/i_am_shell.sh"
# run a shell script with interpreter, also add script info
config = { interpreter = "bash", command = "echo 'test'", info = "Script to test" }
# run inline script
build = "echo 'build'"
# run chain of scripts
release = { include = ["i_am_shell", "build"] }