@@ -5,7 +5,6 @@ var AWS = require('aws-sdk');
55var CoreObject = require ( 'core-object' ) ;
66var Promise = require ( 'ember-cli/lib/ext/promise' ) ;
77var fs = require ( 'fs' ) ;
8- var path = require ( 'path' ) ;
98var readFile = Promise . denodeify ( fs . readFile ) ;
109var mime = require ( 'mime-types' ) ;
1110
@@ -44,14 +43,15 @@ module.exports = CoreObject.extend({
4443 var bucket = options . bucket ;
4544 var acl = options . acl ;
4645 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 ) ;
4848 var putObject = Promise . denodeify ( client . putObject . bind ( client ) ) ;
4949 var gzippedFilePaths = options . gzippedFilePaths || [ ] ;
5050 var isGzipped = gzippedFilePaths . indexOf ( 'index.html' ) !== - 1 ;
5151
5252 var params = {
5353 Bucket : bucket ,
54- Key : key ,
54+ Key : revisionKey ,
5555 ACL : acl ,
5656 ContentType : mime . lookup ( options . filePath ) || 'text/html' ,
5757 CacheControl : 'max-age=0, no-cache'
@@ -73,7 +73,7 @@ module.exports = CoreObject.extend({
7373 . then ( function ( fileContents ) {
7474 params . Body = fileContents ;
7575 return putObject ( params ) . then ( function ( ) {
76- plugin . log ( '✔ ' + key , { verbose : true } ) ;
76+ plugin . log ( '✔ ' + revisionKey , { verbose : true } ) ;
7777 } ) ;
7878 } ) ;
7979 } ,
0 commit comments