v3.0.1: fix missing dir

This commit is contained in:
AJ ONeal 2019-05-11 19:24:37 -06:00
parent db2b0ec82f
commit c35d780321
3 changed files with 18 additions and 4 deletions

View File

@ -1,5 +1,7 @@
'use strict';
var mkdirp = require('@root/mkdirp');
module.exports.create = function (config={}) {
var store = {
options: {},
@ -19,7 +21,13 @@ module.exports.create = function (config={}) {
if (config.storeDatabaseUrl) {
sequelize = new Sequelize(config.storeDatabaseUrl);
} else {
sequelize = new Sequelize({ dialect: 'sqlite', storage: confDir + '/db.sqlite3' });
sequelize = new Promise(function (resolve, reject) {
confDir = confDir.replace(/~\//, require('os').homedir());
mkdirp(confDir, function (err) {
if (err) { reject(err); return; }
resolve(new Sequelize({ dialect: 'sqlite', storage: confDir + '/db.sqlite3' }));
});
});
}
}

9
package-lock.json generated
View File

@ -1,9 +1,14 @@
{
"name": "greenlock-store-sequelize",
"version": "1.0.0",
"name": "@greenlock/store-sequelize",
"version": "3.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@root/mkdirp": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@root/mkdirp/-/mkdirp-1.0.0.tgz",
"integrity": "sha512-hxGAYUx5029VggfG+U9naAhQkoMSXtOeXtbql97m3Hi6/sQSRL/4khKZPyOF6w11glyCOU38WCNLu9nUcSjOfA=="
},
"@types/node": {
"version": "11.13.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-11.13.0.tgz",

View File

@ -1,6 +1,6 @@
{
"name": "@greenlock/store-sequelize",
"version": "3.0.0",
"version": "3.0.1",
"description": "A Sequelize-based certificate store for greenlock that supports wildcards.",
"homepage": "https://git.rootprojects.org/root/greenlock-store-sequelize.js",
"main": "greenlock-store-sequelize.js",
@ -29,6 +29,7 @@
],
"license": "MPL-2.0",
"dependencies": {
"@root/mkdirp": "^1.0.0",
"sequelize": "^5.2.11"
},
"devDependencies": {},