check config in the beginning to avoid doing it all over the place

This commit is contained in:
2020-05-17 09:11:33 +02:00
parent db436587ee
commit abeaacf182
10 changed files with 23 additions and 38 deletions

View File

@@ -1,11 +1,9 @@
import { config } from './autorestic'
import { ConfigError, fill, treeToString } from './utils'
import { fill, treeToString } from './utils'
const showAll = () => {
if (!config) throw ConfigError
console.log('\n\n' + fill(32, '_') + 'LOCATIONS:'.underline)
for (const [key, data] of Object.entries(config.locations)) {
console.log(`\n${key.blue.underline}:`)