vhs icon indicating copy to clipboard operation
vhs copied to clipboard

feat: (fixes #14) add Require command

Open abhijit-hota opened this issue 3 years ago • 1 comments

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.

abhijit-hota avatar Oct 28 '22 10:10 abhijit-hota

Nice! @abhijit-hota This is great!

maaslalani avatar Oct 28 '22 14:10 maaslalani

@abhijit-hota Can I get push access to your fork. I've made some changes that (I think) fix all our concerns.

maaslalani avatar Oct 30 '22 15:10 maaslalani

Added an errors field for runtime errors on the VHS struct:

image

That way the ExecuteRequire can just append to this errors stuff and not exit right away, allowing us to collect all the errors.

maaslalani avatar Oct 30 '22 15:10 maaslalani

Have invited you as collaborator. @maaslalani

abhijit-hota avatar Oct 30 '22 15:10 abhijit-hota

@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.

maaslalani avatar Oct 30 '22 15:10 maaslalani

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.

abhijit-hota avatar Oct 30 '22 15:10 abhijit-hota