fix: Usage of folder trust config flags in FileCommandLoader (#10837)

This commit is contained in:
shrutip90
2025-10-10 11:07:40 -07:00
committed by GitHub
parent 32db4ff66d
commit c6af4eaa00
4 changed files with 19 additions and 26 deletions

View File

@@ -64,11 +64,11 @@ const TomlCommandDefSchema = z.object({
export class FileCommandLoader implements ICommandLoader {
private readonly projectRoot: string;
private readonly folderTrustEnabled: boolean;
private readonly folderTrust: boolean;
private readonly isTrustedFolder: boolean;
constructor(private readonly config: Config | null) {
this.folderTrustEnabled = !!config?.getFolderTrustFeature();
this.folderTrust = !!config?.getFolderTrust();
this.folderTrustEnabled = !!config?.getFolderTrust();
this.isTrustedFolder = !!config?.isTrustedFolder();
this.projectRoot = config?.getProjectRoot() || process.cwd();
}
@@ -101,7 +101,7 @@ export class FileCommandLoader implements ICommandLoader {
cwd: dirInfo.path,
});
if (this.folderTrustEnabled && !this.folderTrust) {
if (this.folderTrustEnabled && !this.isTrustedFolder) {
return [];
}