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({
62
62
var isGzipped = gzippedFilePaths . indexOf ( options . filePattern ) !== - 1 ;
63
63
var isBrotliCompressed = brotliCompressedFilePaths . indexOf ( options . filePattern ) !== - 1 ;
64
64
var serverSideEncryption = options . serverSideEncryption ;
65
+ var checkForOverwrite = RSVP . resolve ( ) ;
65
66
66
67
var params = {
67
68
Bucket : bucket ,
@@ -83,13 +84,17 @@ module.exports = CoreObject.extend({
83
84
params . ContentEncoding = 'br' ;
84
85
}
85
86
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
93
98
. then ( readFile . bind ( this , options . filePath ) )
94
99
. then ( function ( fileContents ) {
95
100
params . Body = fileContents ;
You can’t perform that action at this time.
0 commit comments