generate binary resources hash

This commit is contained in:
Geoffrey Goh
2016-02-24 17:15:58 -08:00
parent e8307d6501
commit eb827d6d32
15 changed files with 414 additions and 86 deletions

View File

@@ -0,0 +1,18 @@
var fs = require("fs");
// Utility function that collects the stats of every file in a directory
// as well as in its subdirectories.
function getFilesInFolder(folderName, fileList) {
var folderFiles = fs.readdirSync(folderName);
folderFiles.forEach(function(file) {
var fileStats = fs.statSync(folderName + "/" + file);
if (fileStats.isDirectory()) {
getFilesInFolder(folderName + "/" + file, fileList);
} else {
fileStats.path = folderName + "/" + file;
fileList.push(fileStats);
}
});
}
module.exports = getFilesInFolder;