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

Avoid temporary file #33

Merged
merged 2 commits into from
Aug 24, 2016
Merged

Avoid temporary file #33

merged 2 commits into from
Aug 24, 2016

Conversation

paparomeo
Copy link
Contributor

@paparomeo paparomeo commented Aug 23, 2016

Since Fish's source allows reading from stdin, all the processing can be done in memory using pipes. This PR implements the required changes, avoiding the need for the temporary file, which simplifies the code and should improve performance.

Use `&&` to chain bash commands so the subprocess fails early and
actually returns the exit code of the failed user command rather than
the result of the Python script that dumps the environment variables.
Avoid need to create the temporary file and do everything in memory by
using pipes since `source` can read from `stdin`.
@edc
Copy link
Owner

edc commented Aug 24, 2016

Looks great! Thanks!

@edc edc merged commit 3e4c13c into edc:master Aug 24, 2016
@paparomeo paparomeo deleted the avoid-temporary-file branch August 24, 2016 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants