-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
26 lines (23 loc) · 907 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/********************************************
* This file is part of Make-Demodb *
* Copyright (c) 2019 by G. Weirich *
* License and terms: see LICENSE *
********************************************/
const processor = require("./process")
const cfg = require("config")
const spawn = require('child_process')
/**
* Entry point. We first launch the shellscript copy_structure which should create an empty destination database
* with same structure as the source database. Then we launch process/index.js to copy the requested data.
*/
const conn=cfg.get("dest.connection")
spawn.execFileSync("./copy_structure",[conn.user,conn.password,cfg.get("source.connection.database"),conn.database])
processor(cfg.get("process"))
.then(result => {
console.log(result)
process.exit(0)
})
.catch(err => {
console.log("***FEHLER*** " + err)
process.exit(-1)
})