1
0
mirror of https://github.com/nttgin/BGPalerter.git synced 2024-05-19 06:50:08 +00:00

fixed volume feature in case of absolute paths (#308)

This commit is contained in:
Massimo Candela
2020-07-27 23:37:42 +02:00
parent e696fc513e
commit 5ef29f1e87

View File

@@ -191,14 +191,16 @@ if (global.DRY_RUN) {
}];
}
config.volume = config.volume || global.EXTERNAL_VOLUME_DIRECTORY || "./";
config.volume = config.volume || global.EXTERNAL_VOLUME_DIRECTORY || "";
if (config.volume.slice(-1) !== "/") {
config.volume += "/";
}
if (config.volume && config.volume.length) {
if (config.volume.slice(-1) !== "/") {
config.volume += "/";
}
if (!fs.existsSync(config.volume)){
fs.mkdirSync(config.volume);
if (!fs.existsSync(config.volume)) {
fs.mkdirSync(config.volume);
}
}
const errorTransport = new FileLogger({