@@ -5,7 +5,6 @@ var AWS = require('aws-sdk');
5
5
var CoreObject = require ( 'core-object' ) ;
6
6
var Promise = require ( 'ember-cli/lib/ext/promise' ) ;
7
7
var fs = require ( 'fs' ) ;
8
- var path = require ( 'path' ) ;
9
8
var readFile = Promise . denodeify ( fs . readFile ) ;
10
9
var mime = require ( 'mime-types' ) ;
11
10
@@ -44,14 +43,15 @@ module.exports = CoreObject.extend({
44
43
var bucket = options . bucket ;
45
44
var acl = options . acl ;
46
45
var allowOverwrite = options . allowOverwrite ;
47
- var key = path . join ( options . prefix , options . filePattern + ":" + options . revisionKey ) ;
46
+ var key = options . filePattern + ":" + options . revisionKey ;
47
+ var revisionKey = joinUriSegments ( options . prefix , key ) ;
48
48
var putObject = Promise . denodeify ( client . putObject . bind ( client ) ) ;
49
49
var gzippedFilePaths = options . gzippedFilePaths || [ ] ;
50
50
var isGzipped = gzippedFilePaths . indexOf ( 'index.html' ) !== - 1 ;
51
51
52
52
var params = {
53
53
Bucket : bucket ,
54
- Key : key ,
54
+ Key : revisionKey ,
55
55
ACL : acl ,
56
56
ContentType : mime . lookup ( options . filePath ) || 'text/html' ,
57
57
CacheControl : 'max-age=0, no-cache'
@@ -73,7 +73,7 @@ module.exports = CoreObject.extend({
73
73
. then ( function ( fileContents ) {
74
74
params . Body = fileContents ;
75
75
return putObject ( params ) . then ( function ( ) {
76
- plugin . log ( '✔ ' + key , { verbose : true } ) ;
76
+ plugin . log ( '✔ ' + revisionKey , { verbose : true } ) ;
77
77
} ) ;
78
78
} ) ;
79
79
} ,
0 commit comments