Jump to content

Custom language location


SFC

Recommended Posts

Apologies if this is somewhere obvious and my searchfu is just weak today.  I'm trying to figure out how within a workflow script, I can set a custom location for the "language".  For example - by default if a script uses php, the language location is /usr/bin/php.  The default OSX php version is old, and I've installed the brew version.  I'd like to be able to easily set the language to /usr/local/opt/php56/bin/php where I have my brew version installed.  I'm not seeing an obvious way to do so.  If there isn't an easy way to do so, any chance the feature can be added?  If there is an easy way to do so and I just missed it, shaming welcome.

 

 

Link to comment

Apologies if this is somewhere obvious and my searchfu is just weak today.  I'm trying to figure out how within a workflow script, I can set a custom location for the "language".  For example - by default if a script uses php, the language location is /usr/bin/php.  The default OSX php version is old, and I've installed the brew version.  I'd like to be able to easily set the language to /usr/local/opt/php56/bin/php where I have my brew version installed.  I'm not seeing an obvious way to do so.  If there isn't an easy way to do so, any chance the feature can be added?  If there is an easy way to do so and I just missed it, shaming welcome.

 

To use a specific script language (or location), the best thing to do is select one of the built in ones (e.g. bash) and then bootstrap over to the language you would like to use. Alfred sets the pwd to the workflow's folder so you could do something as simple as:

 

/usr/local/opt/php56/bin/php ./scriptname.php "{query}"

 

...where scriptname.php is a script stored in the workflow's folder. There are a quite a few workflows which already do this, so you aren't alone!

 

Cheers,

Andrew

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...