Skip to content

Commit

Permalink
Merge pull request #43 from twaggs/upload-prefix-windows
Browse files Browse the repository at this point in the history
Remove path.join on file upload key
  • Loading branch information
LevelbossMike committed Feb 21, 2016
2 parents 55f050b + 13da700 commit 7e08c3b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ var AWS = require('aws-sdk');
var CoreObject = require('core-object');
var Promise = require('ember-cli/lib/ext/promise');
var fs = require('fs');
var path = require('path');
var readFile = Promise.denodeify(fs.readFile);
var mime = require('mime-types');

Expand Down Expand Up @@ -44,14 +43,15 @@ module.exports = CoreObject.extend({
var bucket = options.bucket;
var acl = options.acl;
var allowOverwrite = options.allowOverwrite;
var key = path.join(options.prefix, options.filePattern + ":" + options.revisionKey);
var key = options.filePattern + ":" + options.revisionKey;
var revisionKey = joinUriSegments(options.prefix, key);
var putObject = Promise.denodeify(client.putObject.bind(client));
var gzippedFilePaths = options.gzippedFilePaths || [];
var isGzipped = gzippedFilePaths.indexOf('index.html') !== -1;

var params = {
Bucket: bucket,
Key: key,
Key: revisionKey,
ACL: acl,
ContentType: mime.lookup(options.filePath) || 'text/html',
CacheControl: 'max-age=0, no-cache'
Expand All @@ -73,7 +73,7 @@ module.exports = CoreObject.extend({
.then(function(fileContents) {
params.Body = fileContents;
return putObject(params).then(function() {
plugin.log('✔ ' + key, { verbose: true });
plugin.log('✔ ' + revisionKey, { verbose: true });
});
});
},
Expand Down

0 comments on commit 7e08c3b

Please sign in to comment.