Detect unimported patches

This commit is contained in:
trickypr 2021-09-27 13:08:07 +10:00
parent adf251d9ef
commit 21d2c6c965
6 changed files with 78 additions and 36 deletions

View file

@ -11,6 +11,7 @@ import {
getLatestFF,
projectDir,
SupportedProducts,
walkDirectory,
} from '../utils'
// =============================================================================
@ -194,34 +195,3 @@ async function copyRequired() {
// Utility functions
const sleep = (time: number) => new Promise<void>((r) => setTimeout(r, time))
async function walkDirectory(dirName: string): Promise<string[]> {
const output = []
if (!isAbsolute(dirName)) {
log.askForReport()
log.error('Please provide an absolute input to walkDirectory')
}
try {
const directoryContents = await readdir(dirName)
for (const file of directoryContents) {
const fullPath = join(dirName, file)
const fStat = await stat(fullPath)
if (fStat.isDirectory()) {
for (const newFile of await walkDirectory(fullPath)) {
output.push(newFile)
}
} else {
output.push(fullPath)
}
}
} catch (e) {
log.askForReport()
log.error(e)
}
return output
}