refactor(cli): single password config with legacy fallback
This commit is contained in:
parent
24d26365e6
commit
08293e74a0
4 changed files with 13 additions and 11 deletions
|
|
@ -19,7 +19,7 @@ export default Runtime.handler(Commands, (input) =>
|
|||
return yield* Effect.fail(new Error("--server and --standalone cannot be combined"))
|
||||
const transport = yield* Effect.gen(function* () {
|
||||
if (server !== undefined) {
|
||||
const password = Option.getOrUndefined(yield* Env.password)
|
||||
const password = yield* Env.password
|
||||
const explicit = {
|
||||
url: server,
|
||||
headers: password
|
||||
|
|
|
|||
|
|
@ -27,10 +27,13 @@ export default Runtime.handler(
|
|||
if (input.service) yield* Effect.sync(() => process.chdir(Global.Path.home))
|
||||
return yield* Effect.scoped(
|
||||
Effect.gen(function* () {
|
||||
const standalonePassword = Option.getOrUndefined(yield* Env.serverPassword)
|
||||
const standalonePassword = yield* Env.password
|
||||
// Keep the lease credential out of the environment inherited by any
|
||||
// process this server spawns.
|
||||
if (input.stdio) delete process.env.OPENCODE_SERVER_PASSWORD
|
||||
if (input.stdio) {
|
||||
delete process.env.OPENCODE_PASSWORD
|
||||
delete process.env.OPENCODE_SERVER_PASSWORD
|
||||
}
|
||||
const config = input.service ? yield* ServiceConfig.read() : {}
|
||||
const password = input.service
|
||||
? yield* ServiceConfig.password()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue