fix: use type -q and stdin for op inject to support WSL interop alias

This commit is contained in:
2026-04-13 15:29:13 +08:00
parent 024ea2c676
commit 50808a9ecf
+2 -2
View File
@@ -61,8 +61,8 @@
end end
# 1Password env vars (single op call, silent if locked) # 1Password env vars (single op call, silent if locked)
if command -q op if type -q op; and test -f ~/.config/op/env.tpl
for line in (op inject -i ~/.config/op/env.tpl 2>/dev/null) for line in (op inject < ~/.config/op/env.tpl 2>/dev/null)
set -l kv (string split -m 1 '=' $line) set -l kv (string split -m 1 '=' $line)
if test (count $kv) -ge 2 if test (count $kv) -ge 2
set -gx $kv[1] $kv[2] set -gx $kv[1] $kv[2]