data-store
Advanced tools
Comparing version 0.15.1 to 0.15.2
11
index.js
@@ -67,5 +67,5 @@ 'use strict'; | ||
Store.prototype.initStore = function(name) { | ||
this.name = name || utils.project(); | ||
this.name = name || utils.project(process.cwd()); | ||
this.cwd = utils.resolve(this.options.cwd || '~/.data-store'); | ||
this.path = path.resolve(this.cwd, this.name, 'data.json'); | ||
this.path = path.resolve(this.cwd, this.name + '.json'); | ||
this.data = readFile(this.path); | ||
@@ -97,5 +97,6 @@ this.define('cache', utils.clone(this.data)); | ||
utils.validateName(this, name); | ||
var substore = new Store(name); | ||
var base = path.dirname(this.path); | ||
substore.path = path.join(base, 'substores', name + '.json'); | ||
var dir = path.dirname(this.path); | ||
var basename = path.basename(this.path, path.extname(this.path)); | ||
var cwd = path.join(dir, basename); | ||
var substore = new Store(name, {cwd: cwd}); | ||
this[name] = substore; | ||
@@ -102,0 +103,0 @@ return substore; |
{ | ||
"name": "data-store", | ||
"description": "Easily get, set and persist config data.", | ||
"version": "0.15.1", | ||
"version": "0.15.2", | ||
"homepage": "https://github.com/jonschlinkert/data-store", | ||
@@ -6,0 +6,0 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20013
394
45034