feat: (fixes #14) add Require command
As per the discussion in #14 and the verdict in the comment: https://github.com/charmbracelet/vhs/issues/14#issuecomment-1281083943, this PR aims to implement the Require method that detects missing binaries to fail early.
Nice! @abhijit-hota This is great!
@abhijit-hota Can I get push access to your fork. I've made some changes that (I think) fix all our concerns.
Added an errors field for runtime errors on the VHS struct:
That way the ExecuteRequire can just append to this errors stuff and not exit right away, allowing us to collect all the errors.
Have invited you as collaborator. @maaslalani
@abhijit-hota Thanks, pushed up changes.
I think this makes it a lot more like the other commands and now allows us to have runtime errors as well.
It does mean that Requires must always be near the top of the file but I think that's important for readability anyway so that people looking at tape files know exactly what programs they need.
Great! :tada:
It does mean that Requires must always be near the top of the file but I think that's important for readability anyway so that people looking at tape files know exactly what programs they need.
Got it. We should document this in the README as well.