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