@wocker/core
Advanced tools
Comparing version 1.0.19-dev.1 to 1.0.19-dev.2
@@ -5,2 +5,3 @@ import { WriteFileOptions, MakeDirectoryOptions, RmOptions, WriteStream, ReadStream } from "fs"; | ||
protected readonly pluginDir: string; | ||
protected _fs?: FileSystem; | ||
constructor(pluginDir: string); | ||
@@ -7,0 +8,0 @@ get fs(): FileSystem; |
@@ -33,10 +33,12 @@ "use strict"; | ||
get fs() { | ||
if (!this.pluginDir) { | ||
throw new Error("Plugin dir missed"); | ||
if (!this._fs) { | ||
if (!this.pluginDir) { | ||
throw new Error("Plugin dir missed"); | ||
} | ||
this._fs = new makes_1.FileSystem(this.pluginDir); | ||
if (!this._fs.exists()) { | ||
this._fs.mkdir(); | ||
} | ||
} | ||
const fs = new makes_1.FileSystem(this.pluginDir); | ||
if (!fs.exists()) { | ||
fs.mkdir(); | ||
} | ||
return fs; | ||
return this._fs; | ||
} | ||
@@ -43,0 +45,0 @@ /** @deprecated */ |
{ | ||
"name": "@wocker/core", | ||
"version": "1.0.19-dev.1", | ||
"version": "1.0.19-dev.2", | ||
"author": "Kris Papercut <krispcut@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "Core of the Wocker", |
101089
2566