bower/bower — pull request #1470 by jfsiii (2014-08-14 03:04:27+00:00)
Title: "analytics" value in `.bowerrc` removes need to prompt user

**Goal:** prevent all prompting for analytics without adding CLI args to every `bower` invocation.

Currently, specifying `"analytics": false` in `.bowerrc` will prevent the prompt, but `"analytics": true` will not. There is no need to prompt the user if the answer is supplied via args *or* `.bowerrc`.

I'd love to supply tests, but didn't see any existing ones to extend. Please let me know how you'd like me to test these changes. While developing, I had `console.log` statements in each branch, here's a log of several different scenarios:

```
# no .bowerrc, no stored value, no CLI
> ./bin/bower
no explicit analytics value
stored analytics value true

# no .bowerrc, no stored value, CLI option
> ./bin/bower --config.analytics=false
use the specified value of false

# no .bowerrc, no stored value, CLI option
> ./bin/bower --config.analytics=true
use the specified value of true

# no .bowerrc, no stored value, CLI option
> ./bin/bower --config.interactive=true
no explicit analytics value
no stored value
is interactive
[?] May bower anonymously report usage statistics to improve the tool over time? (Y/n)

# no .bowerrc, no stored value, CLI option
> ./bin/bower --config.interactive=false
no explicit analytics value
no stored value
is not interactive, set analytics to false

# .bowerrc analytics=false, no stored value, no cli
> ./bin/bower
use the specified value of false

# .bowerrc analytics=true, no stored value, no cli
> ./bin/bower
use the specified value of true

# .bowerrc interactive=false, no stored value, no cli
> ./bin/bower
no explicit analytics value
no stored value
is not interactive, set analytics to false

# .bowerrc interactive=true, no stored value, no cli
> ./bin/bower
no explicit analytics value
no stored value
is interactive
[?] May bower anonymously report usage statistics to improve the tool over time? (Y/n)

# no .bowerrc, stored value true (optOut=false), no CLI
> ./bin/bower
no explicit analytics value
stored analytics value true

# no .bowerrc, stored value false (optOut=true), no CLI
> ./bin/bower
no explicit analytics value
stored analytics value false
```