Jump to content

Including a unix binary (and calling it) within an Alfred workflow - how?

Recommended Posts

I'm writing an Alfred workflow that requires use of an external Unix binary.  Currently I am installing this binary using Homebrew; however when I eventually start distributing my workflow, I would rather not have to force the user to set up Xcode command line tools, install Homebrew, etc.  Ideally I'd like to distribute a pre-compiled version of the binary(s) my workflow uses, along with the workflow.  Is it possible to distribute resource(s) (such as binaries, shell scripts/Applescripts, etc.) as part of the Alfred workflow bundle?  And how would one call that binary (i.e. instead of hard-coding a path, like /usr/local/bin/foo)?

Edited by dburr

Share this post

Link to post

Yes, it is possible. Simply call them with a relative path, like if you had just cded to the workflow’s directory as soon as it started.

Edited by Vítor

Share this post

Link to post

You can also just copy the binary into the workflow directory.  And then call with no path.

Well, you'll need to call it with a leading ./ (e.g. ./myprog not just myprog) to tell the shell it's in the working directory, not on PATH.

Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...