Compare commits

...

1 Commits

Author SHA1 Message Date
d82d26f3a7 Disable recursion in readFoldersFromProjectDirectory 2025-05-13 10:16:19 -04:00
2 changed files with 7 additions and 5 deletions

View File

@ -225,7 +225,8 @@ export async function listProjects(
const collectAllFilesRecursiveFrom = async (
path: string,
canReadWritePath: boolean
canReadWritePath: boolean,
shouldRecurse = true
) => {
const RELEVANT_FILE_EXTENSIONS = relevantFileExtensions()
const isRelevantFile = (filename: string): boolean =>
@ -283,7 +284,7 @@ const collectAllFilesRecursiveFrom = async (
const ePath = window.electron.path.join(path, e)
const isEDir = await window.electron.statIsDirectory(ePath)
if (isEDir) {
if (isEDir && shouldRecurse) {
const subChildren = await collectAllFilesRecursiveFrom(
ePath,
canReadWritePath
@ -382,7 +383,7 @@ const directoryCount = (file: FileEntry) => {
return count
}
export async function getProjectInfo(projectPath: string): Promise<Project> {
export async function getProjectInfo(projectPath: string, shouldRecurse = true): Promise<Project> {
// Check the directory.
let metadata
try {
@ -411,7 +412,8 @@ export async function getProjectInfo(projectPath: string): Promise<Project> {
// Return walked early if canReadWriteProjectPath is false
let walked = await collectAllFilesRecursiveFrom(
projectPath,
canReadWriteProjectPath
canReadWriteProjectPath,
shouldRecurse
)
// If the projectPath does not have read write permissions, the default_file is empty string

View File

@ -125,7 +125,7 @@ export const systemIOMachineDesktop = systemIOMachine.provide({
if (!isDirectory) {
continue
}
const project: Project = await getProjectInfo(projectPath)
const project: Project = await getProjectInfo(projectPath, false)
if (
project.kcl_file_count === 0 &&
project.readWriteAccess &&