()
| 50 | } |
| 51 | |
| 52 | load () { |
| 53 | if (!fs.existsSync(this.fullpath())) { |
| 54 | let legacypath = this.legacypath(); |
| 55 | if (legacypath) { |
| 56 | let legacydirs = legacypath.split(path.sep); |
| 57 | legacydirs.pop(); |
| 58 | let legacydir = legacydirs.join(path.sep); |
| 59 | this.initialize( |
| 60 | legacydir, |
| 61 | this.read(legacypath) |
| 62 | ) |
| 63 | } else { |
| 64 | this.write({}); |
| 65 | } |
| 66 | } |
| 67 | return this.read(); |
| 68 | } |
| 69 | |
| 70 | initialize (workpath, data) { |
| 71 | data = data || {}; |
no test coverage detected