New project structure
Beta of extract.js for extracting english locale
This commit is contained in:
parent
e18d2b2f84
commit
2edbd67205
247 changed files with 6405 additions and 4237 deletions
26
server/setup/sql/init.js
Normal file
26
server/setup/sql/init.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
'use strict';
|
||||
|
||||
let dbcheck = require('../../lib/dbcheck');
|
||||
let log = require('npmlog');
|
||||
let path = require('path');
|
||||
let fs = require('fs');
|
||||
|
||||
log.level = 'verbose';
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
log.error('sqlinit', 'This script does not run in production');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV === 'test' && !fs.existsSync(path.join(__dirname, '..', '..', 'config', 'test.toml'))) {
|
||||
log.error('sqlinit', 'This script only runs in test if config/test.toml (i.e. a dedicated test database) is present');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
dbcheck(err => {
|
||||
if (err) {
|
||||
log.error('DB', err);
|
||||
return process.exit(1);
|
||||
}
|
||||
return process.exit(0);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue