mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-01 14:52:25 +00:00
fix: restore recent test regressions and upgrade effect beta (#18158)
This commit is contained in:
@@ -51,6 +51,13 @@ export namespace FileWatcher {
|
||||
if (process.platform === "linux") return "inotify"
|
||||
}
|
||||
|
||||
function protecteds(dir: string) {
|
||||
return Protected.paths().filter((item) => {
|
||||
const rel = path.relative(dir, item)
|
||||
return rel !== "" && !rel.startsWith("..") && !path.isAbsolute(rel)
|
||||
})
|
||||
}
|
||||
|
||||
export const hasNativeBinding = () => !!watcher()
|
||||
|
||||
export class Service extends ServiceMap.Service<Service, {}>()("@opencode/FileWatcher") {}
|
||||
@@ -105,7 +112,7 @@ export namespace FileWatcher {
|
||||
const cfgIgnores = cfg.watcher?.ignore ?? []
|
||||
|
||||
if (yield* Flag.OPENCODE_EXPERIMENTAL_FILEWATCHER) {
|
||||
yield* subscribe(instance.directory, [...FileIgnore.PATTERNS, ...cfgIgnores, ...Protected.paths()])
|
||||
yield* subscribe(instance.directory, [...FileIgnore.PATTERNS, ...cfgIgnores, ...protecteds(instance.directory)])
|
||||
}
|
||||
|
||||
if (instance.project.vcs === "git") {
|
||||
|
||||
@@ -98,6 +98,7 @@ export namespace Process {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
void exited.catch(() => undefined)
|
||||
|
||||
if (opts.abort) {
|
||||
opts.abort.addEventListener("abort", abort, { once: true })
|
||||
|
||||
Reference in New Issue
Block a user