Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

We need a way to specify which shell a script is written for #115

Answered by isaacs
jameshfisher asked this question in CLI
Discussion options

You must be logged in to vote

This is the reason why so many install/build scripts are written as Node.js programs, since you're it's much more likely that node install.js will work.

I'm open to putting the script-shell config in a package.json file somewhere. Maybe it should be in "engines" somewhere, since it's kind of like "this is the platform that should be used to run this package"?

{
  "engines": {
    "node": ">=10",
    "npm": ">=6",
    "shell": "bash"
  }
}

Also, it seems like you expect npm (or perhaps @npmcli/run-script) to add the script-shell config to the SHELL environment variable, which is seems completely reasonable to me.

Maybe the script-shell config should also default to whatever process.env.SHELL

Replies: 8 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by MylesBorins
Comment options

You must be logged in to vote
3 replies
@isaacs
Comment options

@jameshfisher
Comment options

@jpvosloo
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@olfek
Comment options

@trusktr
Comment options

Comment options

You must be logged in to vote
1 reply
@trusktr
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
CLI
Labels
None yet
9 participants