Jump to content

Manage Homebrew Casks with Alfred


pstadler

Recommended Posts

  • 4 months later...

There’s another consideration here. By not sourcing the users’ shell startup files, it can possibly behave differently than from the command line, as it won’t be including homebrew-cask’s options. A warning on the top post that users will need to reproduce these in the workflow (if they have any of them set) would be a good idea, as not doing it can mess organisation quite a bit, like installing and linking to different directories.

On another note, you have some unnecessary code in the workflow. You’re doing

#!/bin/bash

sh cask.sh <arguments>
However, #!/bin/bash is not needed, as Alfred is already taking care of using the correct interpreter. Furthermore, by issuing sh cask.sh you’re actually telling the shell to call another shell to execute the script. You should make the script executable (once, on your side, via chmod +x ./cask.sh), and substitute sh cask.sh <arguments> in the workflow with ./cask.sh <arguments>.
Link to post

Apologies if it was insulting in any way. I don’t intend to use the workflow, but as a homebrew-cask collaborator and avid Alfred user, it interested me, which is why I mentioned the options case as that can break the workflow of unsuspecting users.

It is also so common in these forums (due to Alfred’s workflows being so powerful an easy to use) to find users with little scripting experience (which I now see is not your case), that I got into the habit of explaining in detail how (and why) to make suggested changes. Making code shorter and at the same time more efficient is always good, and my point is simply that Alfred is already good at making some right decisions for us.

Link to post

No worries, I'm not insulted and I agree with you.

 

As a contributor to the homebrew-cask project and the guy who wrote the brew-cask plugin bundled with oh-my-zsh, I hope you keep up the good work! There's definitely potential in this project. Are there any plans regarding a GUI app for the non-devs out there?

Link to post

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...