fixed problem creating node storage directory

This commit is contained in:
tigerbot 2017-06-15 12:45:19 -06:00
parent 26be6411b5
commit 4a237b0703
1 changed files with 5 additions and 0 deletions

View File

@ -9,6 +9,11 @@ var sessionsdir = path.join(oauth3dir, 'sessions');
var directivesdir = path.join(oauth3dir, 'directives');
var metadir = path.join(oauth3dir, 'meta');
// We can reasonably assume the existence of the home directory, but we can't assume
// that there will already be a `.oauth3` directory or anything inside of it.
if (!fs.existsSync(path.join(oauth3dir, '..'))) {
fs.mkdirSync(path.join(oauth3dir, '..'));
}
if (!fs.existsSync(oauth3dir)) {
fs.mkdirSync(oauth3dir);
}