diff options
| author | Aiden Cline <[email protected]> | 2026-02-12 16:38:51 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-12 22:38:51 +0000 |
| commit | f66624fe6eba5aa00662c8d0925c5c6795b2b986 (patch) | |
| tree | 9271573f0c431911737e0be91b40fd6114f9993c | |
| parent | d475fd6137ad669a8a73027d91b516a57846c379 (diff) | |
| download | opencode-f66624fe6eba5aa00662c8d0925c5c6795b2b986.tar.gz opencode-f66624fe6eba5aa00662c8d0925c5c6795b2b986.zip | |
chore: cleanup flag code (#13389)
| -rw-r--r-- | packages/opencode/src/flag/flag.ts | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/packages/opencode/src/flag/flag.ts b/packages/opencode/src/flag/flag.ts index 8c999a1c0..dfcb88bc5 100644 --- a/packages/opencode/src/flag/flag.ts +++ b/packages/opencode/src/flag/flag.ts @@ -1,10 +1,6 @@ -function truthyValue(value: string | undefined) { - const v = value?.toLowerCase() - return v === "true" || v === "1" -} - function truthy(key: string) { - return truthyValue(process.env[key]) + const value = process.env[key]?.toLowerCase() + return value === "true" || value === "1" } export namespace Flag { @@ -41,9 +37,10 @@ export namespace Flag { export const OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER = truthy("OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER") export const OPENCODE_EXPERIMENTAL_ICON_DISCOVERY = OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_ICON_DISCOVERY") + const copy = process.env["OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT"] export const OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT = - copy === undefined ? process.platform === "win32" : truthyValue(copy) + copy === undefined ? process.platform === "win32" : truthy("OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT") export const OPENCODE_ENABLE_EXA = truthy("OPENCODE_ENABLE_EXA") || OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_EXA") export const OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS = number("OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS") |
