jpillora / grunt-aws

A Grunt interface into the Amazon Node.JS SDK
171 stars 44 forks source link

Allow webhosting overwrite #39

Closed vepasto closed 9 years ago

jpillora commented 9 years ago

Currently it seems that websites enabled if they dont exist

if(err && err.name === 'NoSuchWebsiteConfiguration')

Will overwriting by default cause any harm?

vepasto commented 9 years ago

WebHosting settings will not be overwritten by default, because allowWebHostingOverWrite is set false by default

DEFAULTS: allowWebHostingOverWrite: false

if ((err && err.name === 'NoSuchWebsiteConfiguration') || opts.allowWebHostingOverWrite)

I'm using this overwrite in my current application and I don't see any harm this could cause.

jpillora commented 9 years ago

Sorry I should have clarified, instead of this PR can we have no option, and when enableWeb is on - it's always overwritten?

vepasto commented 9 years ago

Users may have changed options by S3 console and those changes will then be overwritten.

vepasto commented 9 years ago

We could make that change if we add major version?

jpillora commented 9 years ago

hmmm maybe instead well add this to the enableWeb option:

This just saves adding another option for something that maybe not many will use, sound ok?

vepasto commented 9 years ago

currently my enableWeb is an object containing custom settings:

enableWeb: {
  <my-own-settings-here>
}

so "force" wont allow this

jpillora commented 9 years ago

Your enableWeb ? An object would also work, falsy, truthy and object with "sub-settings" (which would also be truthy). Then inside there you could an overwrite option?

vepasto commented 9 years ago

This object is directly sent to aws s3, so I would not pollute it with own properties.

vepasto commented 9 years ago

We could add there some kind of prefix to make sure we are not accidentally using S3 properties

jpillora commented 9 years ago

Ah I see, an object is already used, sorry missed that. I think a prefixed property would be fine, like grunt-overwrite.

vepasto commented 9 years ago

Yees! I'll do that!

vepasto commented 9 years ago

@jpillora, please check new commit

vepasto commented 9 years ago

Sorry about pushing incomplete code! But now it works!

jpillora commented 9 years ago

thanks @vepasto sorry for the delay