Skip to content

Instantly share code, notes, and snippets.

@thebigredgeek
Created March 19, 2016 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thebigredgeek/4ac9014411ad5ce71918 to your computer and use it in GitHub Desktop.
Save thebigredgeek/4ac9014411ad5ce71918 to your computer and use it in GitHub Desktop.
var files = [
'javascript/foo.js',
'css/bar.css',
'images/hello.png',
'images/world.jpg'
];
var fileSends = files.map(function (filePath) {
//Loops over files, passing in file[index] as filePath
//It returns a new array based on whatever is returned from each function call
return filesystem.loadFileByPath(filePath) //loads the file off the hard-disk and returns it
})
.map(function (actualFile) {
//So now we have an array of loaded files, which we map again
return amazon.uploadToCDN(actualFile)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment