Update sqlite in setup-database.js

This commit is contained in:
Robbie Antenesse 2019-09-26 18:52:34 -06:00
parent bee0bd7f5e
commit 755b718e15
2 changed files with 9 additions and 3 deletions

4
.gitignore vendored
View File

@ -5,4 +5,6 @@ dist/
dev/
**/*.log
config.json
config.json
*.sqlite*
*.db

View File

@ -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: {