From 4c71fe49d91a1052778efcf687fc80a80524e37e Mon Sep 17 00:00:00 2001 From: Ryan Wilson-Perkin Date: Mon, 17 Dec 2018 19:32:28 -0500 Subject: [PATCH] Allow custom "acl" key in oclif.update.s3 Allows the developer to specify the ACL that their S3 bucket uses, overriding the default of "public-read" which may not be available on some internally-used S3 buckets. --- src/commands/publish/deb.ts | 2 +- src/commands/publish/index.ts | 2 +- src/commands/publish/macos.ts | 2 +- src/commands/publish/win.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands/publish/deb.ts b/src/commands/publish/deb.ts index c7b9eca6..9c21dceb 100644 --- a/src/commands/publish/deb.ts +++ b/src/commands/publish/deb.ts @@ -20,7 +20,7 @@ export default class PublishDeb extends Command { if (!await qq.exists(dist('Release'))) this.error('run "oclif-dev pack:deb" before publishing') const S3Options = { Bucket: s3Config.bucket!, - ACL: 'public-read', + ACL: s3Config.acl || 'public-read', } const remoteBase = buildConfig.channel === 'stable' ? 'apt' : `channels/${buildConfig.channel}/apt` diff --git a/src/commands/publish/index.ts b/src/commands/publish/index.ts index 1344e49c..846e1f6c 100644 --- a/src/commands/publish/index.ts +++ b/src/commands/publish/index.ts @@ -27,7 +27,7 @@ export default class Publish extends Command { if (!await qq.exists(dist(config.s3Key('versioned', {ext: '.tar.gz'})))) this.error('run "oclif-dev pack" before publishing') const S3Options = { Bucket: s3Config.bucket!, - ACL: 'public-read', + ACL: s3Config.acl || 'public-read', } // for (let target of targets) await this.uploadNodeBinary(target) const ManifestS3Options = {...S3Options, CacheControl: 'max-age=86400', ContentType: 'application/json'} diff --git a/src/commands/publish/macos.ts b/src/commands/publish/macos.ts index 5e30e964..68fd5cc2 100644 --- a/src/commands/publish/macos.ts +++ b/src/commands/publish/macos.ts @@ -18,7 +18,7 @@ export default class PublishMacos extends Command { const {s3Config, version, config} = buildConfig const S3Options = { Bucket: s3Config.bucket!, - ACL: 'public-read', + ACL: s3Config.acl || 'public-read', } let root = buildConfig.channel === 'stable' ? '' : `channels/${buildConfig.channel}/` diff --git a/src/commands/publish/win.ts b/src/commands/publish/win.ts index ee91e84f..a5346c80 100644 --- a/src/commands/publish/win.ts +++ b/src/commands/publish/win.ts @@ -18,7 +18,7 @@ export default class PublishWin extends Command { const {s3Config, version, config} = buildConfig const S3Options = { Bucket: s3Config.bucket!, - ACL: 'public-read', + ACL: s3Config.acl || 'public-read', } let root = buildConfig.channel === 'stable' ? '' : `channels/${buildConfig.channel}/`