Created
March 19, 2016 01:25
-
-
Save thebigredgeek/4ac9014411ad5ce71918 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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