Crates.io | bob-the |
lib.rs | bob-the |
version | 0.1.6 |
source | src |
created_at | 2023-04-06 02:31:07.250213 |
updated_at | 2023-04-06 03:49:30.154097 |
description | Small rust scripting language for simple builds. 'Bob the Builder, can we fix it? Bob the Builder, yes we can!' |
homepage | https://github.com/UnsafeOats/bob |
repository | https://github.com/UnsafeOats/bob |
max_upload_size | |
id | 831886 |
size | 18,907 |
Small scripting language for Rust build scripts.
I normally use Nushell for my shell, but most people use Bash/Zsh. This means that for simple scripts I want to run to set up the environment for a program, I either need to:
Now, Rust is absolutely awesome, but for doing a lot of really simple environment setup it just seems annoying and overkill. Now, I can write a small script and call it directly from the Rust code in my build.rs
file.
READ <filepath> -> <variable>
WRITE <filepath> <text>
PRINT <text>
APPEND <string1> <string2> -> <variable>
Putting them all together into a simple script would look like:
WRITE test.txt "why u so ugly bruh?"
READ test.txt statement
PRINT statement
APPEND statement " because i am dawg." -> reply
PRINT reply
If you save the script above to a file named example.btb
, you can then run it inside your build.rs
file like so:
use bob_the::Script;
fn main() {
let script = Script::new("example.btb");
script.run().unwrap();
}
I want to keep this dead-simple, uber-bare-bones, but I'd also like to add the following features:
MIT