Jump to content

Alfred 2 Script Environment


Recommended Posts

Hi,

 

It seems that Alfred does not contain the full environment (ie: the path is not right, environment variables for compilers are not set, etc). I have to source my .zshrc file in a zsh script in order to have a full environment. But, under PHP and Python, I can not seem to get the environment set good. Is it possible for Alfred to have more of the environment setup or should we always plan on it not being there and figure out how to get it right? Thanks.

 

Richard

Link to comment

What variables are you not getting access to? I know some are available because in my PHP utility class that I use, I set paths that include the users home folder in them by grabbing the value of $HOME and saving it into a variable.

 

See this discussion - http://www.alfredforum.com/topic/433-provide-login-session-option-for-bash-scripts/?hl=environment

 

The simplest example is PATH. It's there, but it's a truncated path that doesn't include whatever you set in your initialization scripts. If you set things like JAVA_HOME or whatever else, they won't be there either.

 

This shouldn't be the default behavior, the existing approach is correct. But it would be useful to be able to request a login shell environment when needed.

Link to comment

See this discussion - http://www.alfredforum.com/topic/433-provide-login-session-option-for-bash-scripts/?hl=environment

 

The simplest example is PATH. It's there, but it's a truncated path that doesn't include whatever you set in your initialization scripts. If you set things like JAVA_HOME or whatever else, they won't be there either.

 

This shouldn't be the default behavior, the existing approach is correct. But it would be useful to be able to request a login shell environment when needed.

 

Gotcha, yeah I remember that convo now. Old age is getting to me ha

Link to comment

Gotcha, yeah I remember that convo now. Old age is getting to me ha

Your not old....yet! But, I use oh-my-zsh to setup my environment. All variables that I set inside of the custom section do not get set. I am trying to write a workflow to launch different test servers, the the servers are not finding the environment they need. I guess I will have to create a zsh script file for each server from PHP.

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