Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc fixes to s3-website... path normalization and publish hidden directories as well. #58

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ var assert = require('assert')
var util = require('util')
var path = require('path')
var url = require('url')
var cloudfront = require('cloudfront-tls')
var cloudfront = require('@rlyle1179/cloudfront-tls')
var diff = require('deep-diff').diff
var assign = require('object-assign')
var fs = require('graceful-fs')
var mime = require('mime')
require('dotenv').config({ silent: true })
var s3diff = require('s3-diff')
var s3diff = require('@rlyle1179/s3-diff')
var wildcard = require('wildcard')
var logUpdate = require('log-update')
var array = require('lodash/array')
Expand Down Expand Up @@ -493,8 +493,12 @@ function getConfig (path, fromCL, cb) {
})
}

function normalizePath(path) {
return path.replace(/\\/g,'/');
}

function normalizeKey (prefix, key) {
return prefix ? prefix + '/' + key : key
return normalizePath( prefix ? prefix + '/' + key : key );
}

function deleteFiles (s3, config, files, cb, results = {done: [], errors: []}) {
Expand All @@ -519,7 +523,8 @@ function putWebsiteContent (s3, config, cb) {
bucket: config.domain,
prefix: config.prefix
},
recursive: true
recursive: true,
globOpts: { dot: true }
}, function (err, data) {
if (err) return cb(err)

Expand Down
Loading