cli
cli copied to clipboard
Run `dev.command` with Bash
Which problem is this feature request solving?
build.command and build.ignore both run with Bash.
At the moment, dev.command does not run in any shell.
https://github.com/netlify/cli/blob/4172001e367e5acf395124d55610dec65f3957dc/src/commands/dev/dev.js#L119-L126
This breaks feature parity between Netlify Dev and production.
Also, allowing shell features would be useful to many users.
Finally, it is mostly unexpected by most users, which will use syntax like && which won't work.
Describe the solution you'd like
Run dev.command with Bash.
We should make sure we use Bash, not sh to be consistent with build.command and build.ignore. Concretely, this would mean not using the shell: true option with Execa (or child_process.spawn()), but bash.
This would be a breaking change for some CLI users, so should be behind a major release.
Some Windows machines do not have Bash. For this reason, build.command currently uses cmd.exe on Windows. We might want to replicate this. Alternatively, we could require Bash for Windows users, and validate it when netlify dev is run. But if we do this, we should do it in build.command too.
https://github.com/netlify/build/blob/e969998469e187b37d8423c809f589350dd3c158/packages/build/src/plugins_core/build_command.js#L49-L50
Pull request (optional)
- [ ] I can submit a pull request.