Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't ask for usage permission if non-interactive
You can run the prototype toolkit in a way that does not accept input. A basic example would be: $ npm start | cat If this is the first time you have run the prototype kit, the application will hang as there is no way to respond to the question about recording usage data. This means it is difficult to run the prototype kit solely without user input. This commit changes the behaviour of that prompt to only appear if the user is running the command in a TTY context. If the user is not running the prototype kit in a TTY, the prompt will be skipped and the default action will occur as if the user had simply hit return. In this case, it'll default to "no" and opt the user out of usage data collection automatically. A downside of this approach is that the user will not get asked again if they subsequently run the kit interactively. However, it is unlikely that users will wish to run the prototype kit initially within a pipeline whilst also wishing to run it interactively at a later date. Closes alphagov#695. Another prompt occurs when the chosen port is in use, but this commit doesn't attempt to edit that.
- Loading branch information