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

Fix nix-shell shebang usage #1169

Merged
merged 3 commits into from Jan 3, 2017
Merged

Conversation

dezgeg
Copy link
Contributor

@dezgeg dezgeg commented Jan 3, 2017

5039d3b accidentally broke the nix-shell shebang feature by changing a variable assignment to a shadowing declaration.

Additionally, when writing tests for the shebang feature I noticed it doesn't actually work in a non-interactive context. That is because bash --rcfile just exists without doing anything in a non-interactive context. That is fixed as well.

The 'args' variable here is shadowing one in the outer scope and its
contents end up unused. This causes any '#! nix-shell' lines to
effectively be ignored. The intention here was to clear the args vector,
as far as I can tell (and it seems to work).
I had observed that 'bash --rcfile' would do nothing in a
non-interactive context and cause nothing to be executed if a script
using nix-shell shebangs were run in a non-interactive context.
nix-shell -A, -p and -i are lightly tested.
@edolstra edolstra merged commit ae1e4df into NixOS:master Jan 3, 2017
@edolstra
Copy link
Member

edolstra commented Jan 3, 2017

Thanks!

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.

None yet

2 participants