feat: add cmd_run for heroscript execution

- Add `cmd_run` function to `herocmds` module
- Allow running heroscripts from inline strings via `-s` flag
- Enable running heroscripts from file paths via `-p` flag or as arguments
- Add `-r` flag to reset before running
This commit is contained in:
Mahmoud-Emad
2025-11-17 11:53:48 +02:00
parent 8a7987b9c3
commit 15f81aca41
2 changed files with 128 additions and 3 deletions

View File

@@ -56,8 +56,6 @@ fn do() ! {
version: '1.0.36'
}
// herocmds.cmd_run_add_flags(mut cmd)
mut toinstall := false
if !osal.cmd_exists('mc') || !osal.cmd_exists('redis-cli') {
toinstall = true
@@ -86,6 +84,7 @@ fn do() ! {
base.redis_install()!
herocmds.cmd_run(mut cmd)
herocmds.cmd_git(mut cmd)
herocmds.cmd_generator(mut cmd)
herocmds.cmd_docusaurus(mut cmd)
@@ -104,4 +103,4 @@ fn main() {
print_backtrace()
exit(1)
}
}
}