refactor: isolate legacy flags
This commit is contained in:
parent
407ac2d8aa
commit
43c08387f1
65 changed files with 282 additions and 147 deletions
|
|
@ -72,6 +72,7 @@ Effect.logInfo("cli starting", {
|
|||
Observability.layer({
|
||||
endpoint: process.env.OTEL_EXPORTER_OTLP_ENDPOINT,
|
||||
headers: process.env.OTEL_EXPORTER_OTLP_HEADERS,
|
||||
client: process.env.OPENCODE_CLIENT ?? "cli",
|
||||
}),
|
||||
),
|
||||
Effect.provide(NodeServices.layer),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import type { MiniFrontendInput } from "@opencode-ai/tui/mini"
|
||||
import { createModelPreferenceRepository } from "@opencode-ai/tui/model-preference"
|
||||
import { Flag } from "@opencode-ai/core/flag/flag"
|
||||
import { Global } from "@opencode-ai/core/global"
|
||||
import fs from "node:fs"
|
||||
import { readFile } from "node:fs/promises"
|
||||
|
|
@ -165,7 +164,7 @@ export function createMiniHost(input: {
|
|||
sigusr2: signal("SIGUSR2"),
|
||||
},
|
||||
startup: {
|
||||
showTiming: Flag.OPENCODE_SHOW_TTFD,
|
||||
showTiming: ["1", "true"].includes(process.env.OPENCODE_SHOW_TTFD?.toLowerCase() ?? ""),
|
||||
now: () => performance.now(),
|
||||
},
|
||||
diagnostics: {
|
||||
|
|
|
|||
|
|
@ -69,9 +69,11 @@ const processEffect = Effect.fnUntraced(function* (options: Options) {
|
|||
const instanceID = randomUUID()
|
||||
const server = yield* start(
|
||||
{
|
||||
client: process.env.OPENCODE_CLIENT ?? "cli",
|
||||
hostname,
|
||||
port,
|
||||
password,
|
||||
simulation: truthy(process.env.OPENCODE_SIMULATE),
|
||||
database: {
|
||||
path: process.env.OPENCODE_DB,
|
||||
},
|
||||
|
|
@ -89,6 +91,8 @@ const processEffect = Effect.fnUntraced(function* (options: Options) {
|
|||
project: !truthy(
|
||||
process.env.OPENCODE_CONFIG_PROJECT_DISABLE ?? process.env.OPENCODE_DISABLE_PROJECT_CONFIG,
|
||||
),
|
||||
file: process.env.OPENCODE_CONFIG,
|
||||
content: process.env.OPENCODE_CONFIG_CONTENT,
|
||||
},
|
||||
windows: {
|
||||
gitbash: process.env.OPENCODE_GIT_BASH_PATH,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import { Global } from "@opencode-ai/core/global"
|
||||
import { Flag } from "@opencode-ai/core/flag/flag"
|
||||
import { AppProcess } from "@opencode-ai/core/process"
|
||||
import {
|
||||
InstallationChannel,
|
||||
|
|
@ -138,7 +137,10 @@ export const layer = Layer.effect(
|
|||
})
|
||||
|
||||
const check = Effect.fn("cli.updater.check")(function* () {
|
||||
if (InstallationLocal || Flag.OPENCODE_DISABLE_AUTOUPDATE)
|
||||
if (
|
||||
InstallationLocal ||
|
||||
["1", "true"].includes(process.env.OPENCODE_DISABLE_AUTOUPDATE?.toLowerCase() ?? "")
|
||||
)
|
||||
return yield* Effect.logInfo("update check skipped", {
|
||||
reason: InstallationLocal ? "local-install" : "disabled",
|
||||
version: InstallationVersion,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue