Merge branch '3.0' of https://github.com/calzoneman/sync into 3.0
[KisSync.git] / src / channel-storage / db-chandump.js
blob4af1455f3c3f98dd2aebd3d9003296143310eb1d
1 import Promise from 'bluebird';
3 import Config from '../config';
4 import db from '../database';
5 import { DatabaseStore } from './dbstore';
7 /* eslint no-console: off */
8 function main() {
9 Config.load('config.yaml');
10 db.init();
11 const dbStore = new DatabaseStore();
13 Promise.delay(1000).then(() => {
14 return dbStore.load(process.argv[2]);
15 }).then((data) => {
16 console.log(JSON.stringify(data, null, 4));
17 process.exit(0);
18 }).catch((err) => {
19 console.error(`Error retrieving channel data: ${err.stack}`);
20 process.exit(1);
21 });
24 main();