Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to supply environment variables in runner argument. #64

Closed
rhys-vdw opened this issue Apr 15, 2018 · 3 comments
Closed

Unable to supply environment variables in runner argument. #64

rhys-vdw opened this issue Apr 15, 2018 · 3 comments

Comments

@rhys-vdw
Copy link
Collaborator

Reported by @dreyks here.

options: { runner: 'DISABLE_SPRING=1 bin/rails runner' }

I tried this for other ENV var that i needed and this does not work. parseRunner splits by spaces so the ENV var becomes a file that spawn tries to call

Rather than improving the support for runner string, I think something like this would be most appropriate for the internal usage of spawn.

options: {
  runner: {
    path: 'bin/rails',
    args: ['runner'],
    env: {
      ...process.env,
      DISABLE_SPRING: 1,
    }
  }
}

NOTE: When supplying options.env to spawn it will override the default of passing process.env, so this must be explicitly provided by config. This additionally provides the option of passing {} to prevent this default behaviour.

@PikachuEXE
Copy link
Collaborator

I got a different issue (I think ruby hangs with spring enabled while compiling)
"fixed" by disabling spring in bin/rails but not really a good change
So +1 for this proposal

Maybe I will open a PR for making this change later

@rhys-vdw
Copy link
Collaborator Author

@PikachuEXE yeah, that's be great. It's a pretty trivial change I think.

Btw the problem you're experiencing with spring is #47, which has been very hard to pin down. I guess I should reopen it.

@PikachuEXE
Copy link
Collaborator

Please take a look at #70

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants