Show api_req_started message while verbose details are being built for smoother ux

This commit is contained in:
Saoud Rizwan
2024-08-30 08:35:10 -04:00
parent bf57218ed9
commit dc2f3a5c28
2 changed files with 41 additions and 15 deletions

View File

@@ -105,10 +105,10 @@ export async function listFiles(dirPath: string, recursive: boolean): Promise<st
// globby doesnt natively support top down level by level globbing, so we implement it ourselves
async function globbyLevelByLevel(options?: Options) {
let results: string[] = []
let currentLevel = 1
let currentLevel = 0
while (results.length < LIST_FILES_LIMIT) {
// Construct the glob pattern for the current level
const pattern = `${"*/".repeat(currentLevel)}*`
const pattern = currentLevel === 0 ? "*" : `${"*/".repeat(currentLevel)}*`
// Get files and directories at the current level
const filesAtLevel = await globby(pattern, options)