mirror of https://github.com/calzoneman/sync.git
Add dbstore dumper script
This commit is contained in:
parent
b4b442c897
commit
327b9faedb
|
@ -0,0 +1,25 @@
|
||||||
|
import Promise from 'bluebird';
|
||||||
|
|
||||||
|
import Config from '../config';
|
||||||
|
import db from '../database';
|
||||||
|
import { DatabaseStore } from './dbstore';
|
||||||
|
import { syslog } from '../logger';
|
||||||
|
syslog.log = () => undefined;
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
Config.load('config.yaml');
|
||||||
|
db.init();
|
||||||
|
const dbStore = new DatabaseStore();
|
||||||
|
|
||||||
|
Promise.delay(1000).then(() => {
|
||||||
|
return dbStore.load(process.argv[2]);
|
||||||
|
}).then((data) => {
|
||||||
|
console.log(JSON.stringify(data, null, 4));
|
||||||
|
process.exit(0);
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error(`Error retrieving channel data: ${err.stack}`);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
main();
|
Loading…
Reference in New Issue