mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-26 20:46:17 +00:00
create db dir if not exist
This commit is contained in:
parent
20347e9005
commit
da88eec40d
15
app.js
15
app.js
@ -143,13 +143,12 @@ Steppy(
|
|||||||
// path to root dir (with projects, builds etc)
|
// path to root dir (with projects, builds etc)
|
||||||
app.config.paths.data = path.join(process.cwd(), 'data');
|
app.config.paths.data = path.join(process.cwd(), 'data');
|
||||||
app.config.paths.projects = path.join(app.config.paths.data, 'projects');
|
app.config.paths.projects = path.join(app.config.paths.data, 'projects');
|
||||||
app.config.paths.builds = path.join(app.config.paths.data, 'builds');
|
|
||||||
app.config.paths.db = path.join(app.config.paths.data, 'db');
|
app.config.paths.db = path.join(app.config.paths.data, 'db');
|
||||||
app.config.paths.preload = path.join(app.config.paths.data, 'preload.json');
|
app.config.paths.preload = path.join(app.config.paths.data, 'preload.json');
|
||||||
|
|
||||||
var buildDirExistsCallback = this.slot();
|
var dbDirExistsCallback = this.slot();
|
||||||
fs.exists(app.config.paths.builds, function(isExists) {
|
fs.exists(app.config.paths.db, function(isExists) {
|
||||||
buildDirExistsCallback(null, isExists);
|
dbDirExistsCallback(null, isExists);
|
||||||
});
|
});
|
||||||
|
|
||||||
var preloadExistsCallback = this.slot();
|
var preloadExistsCallback = this.slot();
|
||||||
@ -157,11 +156,11 @@ Steppy(
|
|||||||
preloadExistsCallback(null, isExists);
|
preloadExistsCallback(null, isExists);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
function(err, isBuildsDirExists, isPreloadExists) {
|
function(err, isDbDirExists, isPreloadExists) {
|
||||||
if (!isBuildsDirExists) {
|
if (isDbDirExists) {
|
||||||
fs.mkdir(app.config.paths.builds, this.slot());
|
|
||||||
} else {
|
|
||||||
this.pass(null);
|
this.pass(null);
|
||||||
|
} else {
|
||||||
|
fs.mkdir(app.config.paths.db, this.slot());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPreloadExists) {
|
if (isPreloadExists) {
|
||||||
|
Loading…
Reference in New Issue
Block a user