guardian / homebrew-devtools

A homebrew tap containing dev tools for the Guardian
2 stars 3 forks source link

Add cask for grid cli #83

Closed andrew-nowak closed 2 years ago

andrew-nowak commented 2 years ago

What does this change?

Adds a cask for the Grid CLI (I did try for a while to set up a Formula, but got lost in the complexity of creating a formula for a node project. It seems a lot easier to make use of the nicely packaged release in Grid CLI)

akash1810 commented 2 years ago

Interestingly we've previously added and removed grid-cli from here. The reasoning for the latter is a little lost in time. No objection to adding it back.

Curiously this PR looks different from the original, specifically the CLIENT_HOME part. Not sure if that's an issue still or how to test? The original version was also a Formula whereas this is a Cask - unsure if there's a reason for that?

akash1810 commented 2 years ago

(Pressed all the wrong buttons! Didn't mean to close the PR!)

andrew-nowak commented 2 years ago

Curiously this PR looks different from the original, specifically the CLIENT_HOME part. Not sure if that's an issue still or how to test?

thanks! I took a look and as far as I can tell (from this doc page and a quick grep of the oclif repos) this is only used if the cli has the auto-update plugin installed - which grid-cli does not. I tried adding it anyway but it seems that inreplace is only available to casks (and homebrew docs aren't clear on what else to use), which leads on to...

The original version was also a Formula whereas this is a Cask - unsure if there's a reason for that?

I'm generating the github release downloads using the oclif packager, which creates a bundle including a node binary. The only thing that brew needs to do is extract the tarball, which I think cask is better at. A formula could do it, but I couldn't find a concise way of picking which of x64/arm64 to use (casks make it easy), nor could I get my head around the docs for building node formulae from source