diff --git a/sidecar/tea-config.ts b/sidecar/tea-config.ts index 12822a8..a85bba2 100644 --- a/sidecar/tea-config.ts +++ b/sidecar/tea-config.ts @@ -3,6 +3,7 @@ import { homedir } from 'node:os'; import { join } from 'node:path'; import { getUserById } from 'officerdb'; import { osUserHome, runAs } from '@@/os-user'; +import { locateBinary } from '@@/plugins/os-deps'; // Reading and writing `tea`'s own config, per user. // @@ -45,9 +46,14 @@ const isOwnerUser = (osUser: string | null): boolean => !osUser || osUser === pr * * Resolved once per call rather than cached: an install can add it while this process is running, and a * cached "missing" would outlive the thing that fixed it. + * + * `locateBinary` is the PLATFORM's resolver, not a copy of it. This used to hardcode + * `~/.local/bin:$PATH`, which was right for tea and wrong as a habit — iris wrote the same function with + * `~/.cargo/bin` added, the two disagreed, and a rustup-only machine was refused a plugin it could build. + * The shared one asks the owner's login shell, so it knows about every directory a per-user installer + * added without anybody listing them. */ -const teaBinary = (): string => - Bun.which('tea', { PATH: `${join(homedir(), '.local', 'bin')}:${process.env.PATH ?? ''}` }) ?? 'tea'; +const teaBinary = (): string => locateBinary('tea') ?? 'tea'; const configPathFor = (home: string): string => join(home, '.config', 'tea', 'config.yml');