| 48 | * Given a directory return all files recursively from subdirectories |
| 49 | */ |
| 50 | export function getAllFiles(dirPath, arrayOfFiles) { |
| 51 | const files = fs.readdirSync(dirPath) |
| 52 | arrayOfFiles = arrayOfFiles || [] |
| 53 | files.forEach(function (file) { |
| 54 | if (fs.statSync(dirPath + '/' + file).isDirectory()) { |
| 55 | arrayOfFiles = getAllFiles(dirPath + '/' + file, arrayOfFiles) |
| 56 | } else { |
| 57 | arrayOfFiles.push(join(dirPath, '/', file)) |
| 58 | } |
| 59 | }) |
| 60 | return arrayOfFiles |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * Get the available packages from the packages directory. |