diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2022-12-09 21:46:57 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2022-12-09 21:46:57 +0100 |
| commit | f91c2b4feb85933bc190712b45788d2f24fe851d (patch) | |
| tree | 86c2fc07b41c697ff4039df797fa90835db696f0 /lib/remote.js | |
| parent | bd8c1fa2774b98b22939d60c06a06525691867ce (diff) | |
Remove unnecessary logging
Diffstat (limited to 'lib/remote.js')
| -rw-r--r-- | lib/remote.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/remote.js b/lib/remote.js index 569cd25..8b29c4e 100644 --- a/lib/remote.js +++ b/lib/remote.js @@ -11,22 +11,27 @@ const internals = { module.exports = { async add(remoteConfig, remote) { + await writeFile(remoteConfig, remote); }, async remove(remoteConfig) { + await rm(remoteConfig, { force: true }) }, async syncUp(remoteConfig, blogDirectory) { + await this._executeMethodOnStrategy(remoteConfig, 'syncUp', blogDirectory); }, async syncDown(remoteConfig, blogDirectory) { + await this._executeMethodOnStrategy(remoteConfig, 'syncDown', blogDirectory); }, async _executeMethodOnStrategy(remoteConfig, method, blogDirectory) { + const remote = await this._ensureConfiguration(remoteConfig); for (const strategy of internals.strategies) { @@ -37,6 +42,7 @@ module.exports = { }, async _ensureConfiguration(remoteConfig) { + try { const configuration = await readFile(remoteConfig, { encoding: 'utf8' }); return configuration; |