3 ms·
There are few things more infuriating than a build tool that prompts for user input when it doesn't need to. Most people like to automate these things, and havi
by bschwindHN 11y ago
There are few things more infuriating than a build tool that prompts for user input when it doesn't need to. Most people like to automate these things, and having a prompt ask for input after typing `make` is completely unexpected and annoying.
Bower is a particularly bad offender here. By default it will periodically ask you if it can send anonymous usage statistics. If you've never experienced it before, you have to angrily google the problem once piping `yes` to it fails and find a github issue where the solution is `bower install --config.interactive=false`
Always assume your build tool is running in an automated environment without user input. If the user wants to do something out of the ordinary, provide command line options and try to follow the conventions that already exist.
- solipsism 11y agoI agree 100% that a good build tool makes it easy to build in an automated context. But that's not relevant here, is it? make build is not less automatable than make. Sure, someone has to manually run make once to figure out what the actual build command is. But no person in his right mind would automate a build without running it manually once. I say this as someone whose job it used to be too automate builds.
- bschwindHN 11y agoYeah you're right, you'd run it at least once locally and discover what the right command is. I guess I'm just letting my feelings for Bower permeate to other build tools, because sometimes it'll run without user input, and other times it will prompt for it.
- ars 11y agoIt's not that hard to use the tty command to see if it's an interactive shell and set the config appropriately. Bower should do that automatically.
- vog 11y agoBut this is yet another anti-pattern: Having different behaviour depending on whether it's an interactive shell or not. A big offender here is CURL, where this affects the verbosity during download. This is especially frustrating with regard to automation. 1. You type by hand, everything works. 2. You copy&paste into the command line, and everything works. 3. You run it from a script, and it behaves differently.