chore(fs): ignore enabled option

It makes no sense for this library to handled disabled remote.
This commit is contained in:
Julien Fontanet
2018-11-13 15:48:10 +01:00
parent f8fbb6b7d3
commit b4cbd8b2b5
3 changed files with 8 additions and 14 deletions

View File

@@ -27,11 +27,10 @@ export default class LocalHandler extends RemoteHandlerAbstract {
}
async _sync () {
if (this._remote.enabled) {
const path = this._getRealPath()
await fs.ensureDir(path)
await fs.access(path, fs.R_OK | fs.W_OK)
}
const path = this._getRealPath()
await fs.ensureDir(path)
await fs.access(path, fs.R_OK | fs.W_OK)
return this._remote
}

View File

@@ -55,11 +55,7 @@ export default class NfsHandler extends LocalHandler {
}
async _sync () {
if (this._remote.enabled) {
await this._mount()
} else {
await this._umount()
}
await this._mount()
return this._remote
}

View File

@@ -70,10 +70,9 @@ export default class SmbHandler extends RemoteHandlerAbstract {
}
async _sync () {
if (this._remote.enabled) {
// Check access (smb2 does not expose connect in public so far...)
await this.list()
}
// Check access (smb2 does not expose connect in public so far...)
await this.list()
return this._remote
}