mirror of
https://github.com/zen-browser/surfer.git
synced 2025-07-10 10:15:31 +02:00
✨ Detect unimported patches
This commit is contained in:
parent
adf251d9ef
commit
21d2c6c965
6 changed files with 78 additions and 36 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue