GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore: cleanup flag code (#13389) · un33k/opencode@f66624f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/opencode/src/flag
    • flag.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/opencode/src/flag/flag.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/flag/flag.ts
+4-7Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
function truthyValue(value: string | undefined) {
2-
const v = value?.toLowerCase()
3-
return v === "true" || v === "1"
4-
}
5-
61
function truthy(key: string) {
7-
return truthyValue(process.env[key])
2+
const value = process.env[key]?.toLowerCase()
3+
return value === "true" || value === "1"
84
}
95

106
export namespace Flag {
@@ -41,9 +37,10 @@ export namespace Flag {
4137
export const OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER = truthy("OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER")
4238
export const OPENCODE_EXPERIMENTAL_ICON_DISCOVERY =
4339
OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_ICON_DISCOVERY")
40+
4441
const copy = process.env["OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT"]
4542
export const OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT =
46-
copy === undefined ? process.platform === "win32" : truthyValue(copy)
43+
copy === undefined ? process.platform === "win32" : truthy("OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT")
4744
export const OPENCODE_ENABLE_EXA =
4845
truthy("OPENCODE_ENABLE_EXA") || OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_EXA")
4946
export const OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS = number("OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS")

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.