mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2024-09-29 04:44:42 +02:00
28 lines
678 B
TypeScript
28 lines
678 B
TypeScript
|
import { config } from './autorestic'
|
||
|
import { ConfigError, 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}:`)
|
||
|
console.log(treeToString(
|
||
|
data,
|
||
|
['to:', 'from:', 'hooks:', 'options:'],
|
||
|
))
|
||
|
}
|
||
|
|
||
|
console.log('\n\n' + fill(32, '_') + 'BACKENDS:'.underline)
|
||
|
for (const [key, data] of Object.entries(config.backends)) {
|
||
|
console.log(`\n${key.blue.underline}:`)
|
||
|
console.log(treeToString(
|
||
|
data,
|
||
|
['type:', 'path:', 'key:'],
|
||
|
))
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default showAll
|