From 755b718e153ca33221f501af53cffbad8cebf0d0 Mon Sep 17 00:00:00 2001 From: Robbie Antenesse Date: Thu, 26 Sep 2019 18:52:34 -0600 Subject: [PATCH] Update sqlite in setup-database.js --- .gitignore | 4 +++- setup-database.js | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index d6668ba..0e2c144 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,6 @@ dist/ dev/ **/*.log -config.json \ No newline at end of file +config.json +*.sqlite* +*.db \ No newline at end of file diff --git a/setup-database.js b/setup-database.js index cef6d58..52dc4a8 100644 --- a/setup-database.js +++ b/setup-database.js @@ -16,8 +16,12 @@ const sequelizeConfig = { switch (siteConfig.db_engine) { case 'sqlite': { sequelizeConfig.storage = typeof siteConfig.sqlite_location !== 'undefined' - ? path.resolve(siteConfig.sqlite_location) - : path.resolve(__dirname, './database.sqlite'); + ? ( + siteConfig.sqlite_location.substr(0, 1) === '.' // If relative path, make relative to ./server + ? path.resolve('./server/', siteConfig.sqlite_location) + : path.resolve(siteConfig.sqlite_location) + ) + : path.resolve(__dirname, './server/database.sqlite'); break; } default: {