diff options
| author | HampusM <hampus@hampusmat.com> | 2026-08-31 00:15:14 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-08-31 00:15:14 +0200 |
| commit | 05f53637e99e9874e63749124716a770fd58fd43 (patch) | |
| tree | e025fb66101856c52e20437e3587a8d0438a7e86 /xtask/src/main.rs | |
| parent | 2d8946bc44b4cf894655a0c1108afa8ce8962077 (diff) | |
build: add cargo aliases for doing fast compilation
Diffstat (limited to 'xtask/src/main.rs')
| -rw-r--r-- | xtask/src/main.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/xtask/src/main.rs b/xtask/src/main.rs new file mode 100644 index 0000000..e955925 --- /dev/null +++ b/xtask/src/main.rs @@ -0,0 +1,24 @@ +use std::process::Command; + +fn main() +{ + let mut args = std::env::args(); + + let Some(task) = args.nth(1) else { + println!("Error: No task is specified"); + return; + }; + + if task == "execute" { + let Some(program) = args.next() else { + println!("Error: No program is specified"); + return; + }; + + if let Err(err) = Command::new(program).args(args).status() { + println!("Error: Failed to execute command: {err}"); + } + } else { + println!("Error: Unknown task '{task}'"); + } +} |
