@appzung/react-native-code-push
Version:
React Native plugin for the CodePush service
20 lines (17 loc) • 608 B
JavaScript
var fs = require('fs');
var path = require('path');
// 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(path.join(folderName, file));
if (fileStats.isDirectory()) {
getFilesInFolder(path.join(folderName, file), fileList);
} else {
fileStats.path = path.join(folderName, file);
fileList.push(fileStats);
}
});
}
module.exports = getFilesInFolder;