Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/bold-trees-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@varlock/1password-plugin": patch
---

pass through USER and HOME to op cli calls
9 changes: 7 additions & 2 deletions packages/plugins/1password/src/cli-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,14 @@ async function executeReadBatch(batchToExecute: NonNullable<typeof opReadBatch>)
// because otherwise we'll have trouble dealing with values that contain newlines
await spawnAsync('op', `run --no-masking ${lockCliToOpAccount ? `--account ${lockCliToOpAccount} ` : ''}-- env -0`.split(' '), {
env: {
// have to pass through at least path so it can find `op`, but might need other items too?
// have to pass a few things through at least path so it can find `op` and related config files
PATH: process.env.PATH!,
// ...process.env as any,
...process.env.USER && { USER: process.env.USER },
...process.env.HOME && { HOME: process.env.HOME },
...process.env.XDG_CONFIG_HOME && { XDG_CONFIG_HOME: process.env.XDG_CONFIG_HOME },
// this setting actually just enables the CLI + Desktop App integration
// which in some cases op has a hard time detecting via app setting
OP_BIOMETRIC_UNLOCK_ENABLED: 'true',
...envMap,
},
})
Expand Down
Loading