mirror of
https://github.com/anomalyco/opencode.git
synced 2026-02-01 22:48:16 +00:00
core: prevent file system scanning when in root directory to avoid unnecessary operations
This commit is contained in:
@@ -125,6 +125,8 @@ export namespace File {
|
||||
let cache: Entry = { files: [], dirs: [] }
|
||||
let fetching = false
|
||||
const fn = async (result: Entry) => {
|
||||
// Disable scanning if in root of file system
|
||||
if (Instance.directory === path.parse(Instance.directory).root) return
|
||||
fetching = true
|
||||
const set = new Set<string>()
|
||||
for await (const file of Ripgrep.files({ cwd: Instance.directory })) {
|
||||
|
||||
Reference in New Issue
Block a user