Crates.io | runscript |
lib.rs | runscript |
version | 2.0.0-alpha.2 |
source | src |
created_at | 2020-06-25 00:01:01.549359 |
updated_at | 2021-08-02 06:57:16.812752 |
description | Project execution script manager |
homepage | |
repository | https://github.com/TheOnlyMrCat/runscript |
max_upload_size | |
id | 257728 |
size | 112,886 |
Runscript is a tool like make
which manages run commands. Runscript can also handle building, but it doesn't track file update times (yet?), so you may still want to use make for that (but you can call it from runscript).
For an example of a useful runscript, see the runfile for this repository.
Binaries are available from the releases page. Alternatively, you can use cargo to build and install it. Supporting package managers is difficult, so I'm not going to try doing it until this gets real use.
If you have cargo, and are fine with building from source, runscript is on crates.io
cargo install runscript
When run
is executed, it looks for a file run
in the current working directory (other files can be specified). It
searches this runfile for scripts, which look like the following:
#target phase
commands
#/
target
can be -
for the default target, #
for the global target, or anything else for a named target (matching the regex
[A-Za-z0-9_]*
).
phase
can be one of the following sets of characters:
Text | Phase |
---|---|
b! |
Build Only |
b |
Build |
(blank) | Build and Run |
br |
Build and Run |
r |
Run |
r! |
Run Only |
The phases that are executed depend on flags passed to run
.
Phase | -b , --build-only |
(blank), --build-and-run |
-r , --run-only |
---|---|---|---|
Build Only | ✓ | ||
Build | ✓ | ✓ | |
Build and Run | ✓ | ||
Run | ✓ | ✓ | |
Run Only | ✓ |
If multiple phase flags are passed, the one provided last is used.
commands
is a newline-separated list of terminal commands to be executed. In other words, a shell script. Not all script
features are currently supported, however. A list of supported features follows:
*.run
glob matching (only *
, ?
, **
, {}
)$VAR
environment variables$(echo)
internal subcommands$1
positional arguments$@
all positional arguments&&
, ||
, and |
(no ;
, just use newlines)VAR=val
Environment variable setting (with interpolation)Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.