1
0
mirror of https://github.com/louislam/uptime-kuma.git synced 2024-11-24 08:32:23 +02:00

create data dir before copy

This commit is contained in:
LouisLam 2021-09-02 21:11:20 +08:00
parent 582e14098d
commit b30b1d3a52

View File

@ -53,8 +53,8 @@ const sslCert = process.env.SSL_CERT || args["ssl-cert"] || undefined;
// Data Directory (must be end with "/")
Database.dataDir = process.env.DATA_DIR || args["data-dir"] || "./data/";
Database.path = Database.dataDir + "kuma.db";
if (! fs.existsSync(this.dataDir)) {
fs.mkdirSync(this.dataDir, { recursive: true });
if (! fs.existsSync(Database.dataDir)) {
fs.mkdirSync(Database.dataDir, { recursive: true });
}
console.log(`Data Dir: ${Database.dataDir}`);