Check configured paths exist on startup
This commit is contained in:
parent
26e6d56d9b
commit
01fbaad962
1 changed files with 11 additions and 0 deletions
|
@ -76,6 +76,17 @@ module.exports = function(opts, callback) {
|
|||
paths.sprites = path.resolve(paths.root, paths.sprites || '');
|
||||
paths.mbtiles = path.resolve(paths.root, paths.mbtiles || '');
|
||||
|
||||
var checkPath = function(type) {
|
||||
if (!fs.existsSync(paths[type])) {
|
||||
console.error('The specified path for "' + type + '" does not exist (' + paths[type] + ').');
|
||||
process.exit(1);
|
||||
}
|
||||
};
|
||||
checkPath('styles');
|
||||
checkPath('fonts');
|
||||
checkPath('sprites');
|
||||
checkPath('mbtiles');
|
||||
|
||||
var data = clone(config.data || {});
|
||||
|
||||
app.use(cors());
|
||||
|
|
Loading…
Reference in a new issue