Allow the build system to work without bash.#209
Allow the build system to work without bash.#209rsmarples wants to merge 2 commits intonpm:latestfrom rsmarples:sh
Conversation
Don't set -o pipefail as that's bash specific with no equivalent.
|
I'm not sure why this is necessary. The team that regularly runs these commands all use computers with bash installed. My concern would be that making these shell scripts fully sh-compliant imposes a constraint that we can't guarantee and won't notice violating in the future. (For example, The only script that would really need to be portable is Is there a use-case I'm missing? Have you run into issues working with npm on systems that don't have Bash installed? |
That's no different from using something provided by Linux but not present on NetBSD. Can you guarantee bash version compliance? You could use the =~ operator in the future and that doesn't work with older versions of bash. Also, where is bash installed? On my hosts with bash it's in /usr/pkg/bin/bash. Anyway, for the most part just changing from bash to sh still allows the scripts to mostly work - it's just the use of arrays that's the unportable part. String contatenation and wordsplitting solves this.
The systems I use npm on do infact have bash and npm works fine as is. |
|
I'd recommend installing a modern (>= v3.x) version of Bash on your build machine. It's a relatively small binary, compared to the needs of npm (node, python, etc.) Maintaining this patch will be too likely to break in the future, so I'm going to close it. Sorry for the inconvenience and wasted time. I hope this won't dissuade you from contributing in the future :) |
Tested on NetBSD using pkgsrc without bash installed.