(cwd, overwrites)
| 12 | } |
| 13 | |
| 14 | function readCachedConfig(cwd, overwrites) { |
| 15 | current = bowerConfig.create(cwd).load(overwrites); |
| 16 | |
| 17 | var config = current.toObject(); |
| 18 | |
| 19 | var configstore = new Configstore('bower-github').all; |
| 20 | |
| 21 | object.mixIn(config, configstore); |
| 22 | |
| 23 | // If interactive is auto (null), guess its value |
| 24 | if (config.interactive == null) { |
| 25 | config.interactive = |
| 26 | process.bin === 'bower' && tty.isatty(1) && !process.env.CI; |
| 27 | } |
| 28 | |
| 29 | // Merge common CLI options into the config |
| 30 | if (process.bin === 'bower') { |
| 31 | var cli = require('./util/cli'); |
| 32 | |
| 33 | object.mixIn( |
| 34 | config, |
| 35 | cli.readOptions({ |
| 36 | force: { type: Boolean, shorthand: 'f' }, |
| 37 | offline: { type: Boolean, shorthand: 'o' }, |
| 38 | verbose: { type: Boolean, shorthand: 'V' }, |
| 39 | quiet: { type: Boolean, shorthand: 'q' }, |
| 40 | loglevel: { type: String, shorthand: 'l' }, |
| 41 | json: { type: Boolean, shorthand: 'j' }, |
| 42 | silent: { type: Boolean, shorthand: 's' } |
| 43 | }) |
| 44 | ); |
| 45 | } |
| 46 | |
| 47 | return config; |
| 48 | } |
| 49 | |
| 50 | function restoreConfig() { |
| 51 | if (current) { |
no outgoing calls
no test coverage detected
searching dependent graphs…