X-Git-Url: https://git.r.bdr.sh/rbdr/blog/blobdiff_plain/2acbdb038ea9e9d61ce7ce070629e0187fe95718..e8a4197dcaf454b4dbe76d5ddd84f63fa5693ab9:/lib/blog.js diff --git a/lib/blog.js b/lib/blog.js index 6923a10..ca944cf 100644 --- a/lib/blog.js +++ b/lib/blog.js @@ -97,7 +97,7 @@ module.exports = class Blog { await this.syncDown(); } catch {}; - const metadata = await this._update(); + const metadata = await this._update(postLocation); } /** @@ -108,9 +108,9 @@ module.exports = class Blog { * @return {Promise} empty promise, returns no value * @instance */ - async publish(bucket) { + async publish(host) { - internals.debuglog(`Publishing to ${bucket}`); + internals.debuglog(`Publishing to ${host}`); try { await internals.exec('which aws'); } @@ -119,8 +119,8 @@ module.exports = class Blog { } try { - await internals.exec(`aws s3 sync --acl public-read --delete ${this.staticDirectory} s3://${bucket}`); - await internals.exec(`aws s3 cp --content-type 'text/plain; charset=utf-8 ' --acl public-read ${this.staticDirectory}/index.txt s3://${bucket}`); + internals.debuglog(`Copying ephemeral blog from ${this.staticDirectory}`); + await internals.exec(`rsync -r ${this.staticDirectory}/ ${host}`); } catch (err) { console.error('Failed to publish'); @@ -151,7 +151,7 @@ module.exports = class Blog { try { const gemlogPath = resolve(join(__dirname, '../', '.gemlog')); - internals.debuglog(`Reading archive from ${gemlogPath}`); + internals.debuglog(`Copying archive from ${gemlogPath}`); await internals.exec(`rsync -r ${gemlogPath}/ ${host}`); } catch (err) {