File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ module.exports = CoreObject.extend({
6262 var isGzipped = gzippedFilePaths . indexOf ( options . filePattern ) !== - 1 ;
6363 var isBrotliCompressed = brotliCompressedFilePaths . indexOf ( options . filePattern ) !== - 1 ;
6464 var serverSideEncryption = options . serverSideEncryption ;
65+ var checkForOverwrite = RSVP . resolve ( ) ;
6566
6667 var params = {
6768 Bucket : bucket ,
@@ -83,13 +84,17 @@ module.exports = CoreObject.extend({
8384 params . ContentEncoding = 'br' ;
8485 }
8586
86- return this . findRevision ( options )
87- . then ( function ( found ) {
88- if ( found !== undefined && ! allowOverwrite ) {
89- return RSVP . reject ( "REVISION ALREADY UPLOADED! (set `allowOverwrite: true` if you want to support overwriting revisions)" ) ;
90- }
91- return RSVP . resolve ( ) ;
92- } )
87+ if ( ! allowOverwrite ) {
88+ checkForOverwrite = this . findRevision ( options )
89+ . then ( function ( found ) {
90+ if ( found !== undefined ) {
91+ return RSVP . reject ( "REVISION ALREADY UPLOADED! (set `allowOverwrite: true` if you want to support overwriting revisions)" ) ;
92+ }
93+ return RSVP . resolve ( ) ;
94+ } )
95+ }
96+
97+ return checkForOverwrite
9398 . then ( readFile . bind ( this , options . filePath ) )
9499 . then ( function ( fileContents ) {
95100 params . Body = fileContents ;
You can’t perform that action at this time.
0 commit comments