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

Drop env's -S flag. (#54) #55

Closed
wants to merge 5 commits into from

Conversation

yeldiRium
Copy link
Contributor

I want to offer an implementation that achieves what I have detailled in #54.

I've added tests according to the test setup as I have found it. Please tell me if I am missing quality control somewhere.

References

@nathanlepori
Copy link

I'm having the issue described in #54 as well. I don't see any side effects or downsides, any chance to get this merged?

Copy link

@huan huan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This is the solution that cost me 2+ hours (huan/sidecar#19) yesterday, thank you very much for the fix and I hope it can be available in the most recent NPM versions published soon.

@yeldiRium
Copy link
Contributor Author

I'll ping the most active contributors in hopes that they have maintainer rights and take a look at this.
@isaacs @ForbesLindesay

@isaacs
Copy link
Contributor

isaacs commented Nov 29, 2021

Looks fine to me. We should probably ignore any --prefixed arguments to env in the shebang, tbh.

(Note: I'm no longer a committer on this project. cc: @darcyclarke to have someone on the npm cli team take a look.)

@huan
Copy link

huan commented Feb 11, 2022

I hope this can be fixed in 2022! :)

@darcyclarke darcyclarke requested a review from nlf February 16, 2022 05:41
@darcyclarke darcyclarke added the semver:minor new backwards-compatible feature label Feb 16, 2022
@darcyclarke
Copy link

@ruyadorno / @nlf can either of you take a look at this if/when you may get some time over the next week or so.

@huan
Copy link

huan commented Feb 28, 2022

ping @ruyadorno @nlf

@edemaine
Copy link

+1 for this being merged. See my comment #54 (comment) for why the current state makes cross-platform "bin" impossible.

We should probably ignore any --prefixed arguments to env in the shebang, tbh.

This is less clear to me. For example, -u should unset environment variables. Supporting these correctly would require more work, so it seems better to leave them in and crash, to indicate lack of support.

Luckily, the uses of -S require that it must be the very first argument, so this PR supports what we need for crossplatform scripts.

A small comment: I think (?:\/usr\/bin\/env)?\s* should be (?:\/usr\/bin\/env)?\s+ to prevent /usr/bin/envfoo being interpreted as an env shebang line. This is a bug in the current regexp, not directly relevant to this PR, though.

@yeldiRium Could you maybe resolve the conflicts to increase chance of merging?

@yeldiRium yeldiRium requested a review from a team as a code owner August 12, 2022 08:46
@yeldiRium
Copy link
Contributor Author

Hi @edemaine,

thanks for the feedback. I updated the branch.

I didn't follow the project in the meantime, so I'm not sure if my changes are still valid. What stands out is that there are ESLint errors that occur outside of my changes.

@nlf
Copy link
Contributor

nlf commented Dec 13, 2022

this pull request got a bit stale (our fault! sorry about that!) so i went ahead and rebuilt it as #96 and am closing this one

thank you! for the contribution, it's hugely appreciated and i'm really sorry this didn't go out much sooner!

@nlf nlf closed this Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:minor new backwards-compatible feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants