Skip to content

Commit

Permalink
fix(config): init timestamps and verbose output
Browse files Browse the repository at this point in the history
Save timestamps and correctly print verbose output
  • Loading branch information
drawnepicenter committed Jul 19, 2016
1 parent 43c3ad5 commit 85f86ec
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 23 deletions.
32 changes: 20 additions & 12 deletions build/cmds/config_cmds/init.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 19 additions & 11 deletions src/cmds/config_cmds/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,32 @@ exports.handler = (argv) => {
}
if (fileExists) {
if (argv.f) {
console.log(`Overwrote ${chalk.white.bold(CFILE)}.`)
const config = noon.load(CFILE)
obj.dmuse.date.stamp = config.dmuse.date.stamp
obj.onelook.date.stamp = config.onelook.date.stamp
obj.rbrain.date.stamp = config.rbrain.date.stamp
obj.wordnik.date.stamp = config.wordnik.date.stamp
noon.save(CFILE, obj)
console.log(`Overwrote ${chalk.white.bold(CFILE)}.`)
} else {
console.log(`Using configuration at ${chalk.white.bold(CFILE)}.`)
}
} else if (!fileExists) {
console.log(`Created ${chalk.white.bold(CFILE)}.`)
noon.save(CFILE, obj)
console.log(`Created ${chalk.white.bold(CFILE)}.`)
}
const config = noon.load(CFILE)
const theme = themes.loadTheme(config.theme)
if (config.verbose) themes.labelDown('Configuration', theme, null)
console.log('Your current configuration is:')
console.log(noon.stringify(config, {
indent: 2,
align: true,
maxalign: 32,
sort: true,
colors: true,
}))
if (argv.v) {
themes.labelDown('Configuration', theme, null)
console.log('Your current configuration is:')
console.log(noon.stringify(config, {
indent: 2,
align: true,
maxalign: 32,
sort: true,
colors: true,
}))
console.log('')
}
}

0 comments on commit 85f86ec

Please sign in to comment.