|
|
|
@ -34,7 +34,7 @@ class FSPluginClient extends PluginClient { |
|
|
|
|
watcher: chokidar.FSWatcher |
|
|
|
|
constructor() { |
|
|
|
|
super() |
|
|
|
|
this.methods = ['readdir', 'readFile', 'writeFile', 'mkdir', 'rmdir', 'unlink', 'rename', 'stat', 'exists', 'watch', 'closeWatch'] |
|
|
|
|
this.methods = ['readdir', 'readFile', 'writeFile', 'mkdir', 'rmdir', 'unlink', 'rename', 'stat', 'exists', 'watch', 'closeWatch', 'currentPath'] |
|
|
|
|
createClient(this, profile) |
|
|
|
|
this.onload(() => { |
|
|
|
|
console.log('fsPluginClient onload') |
|
|
|
@ -78,6 +78,10 @@ class FSPluginClient extends PluginClient { |
|
|
|
|
return fs.access(path).then(() => true).catch(() => false) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async currentPath(): Promise<string> { |
|
|
|
|
return process.cwd() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async watch(path: string): Promise<void> { |
|
|
|
|
console.log('watch', path) |
|
|
|
|
if(this.watcher) this.watcher.close() |
|
|
|
|