fix(fish): use --in-file for op inject to fix stdin issue in command substitution
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
inputs,
|
inputs,
|
||||||
lib,
|
|
||||||
username,
|
username,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
|
|||||||
+4
-2
@@ -64,12 +64,14 @@ in
|
|||||||
source ~/.config/fish/local.fish
|
source ~/.config/fish/local.fish
|
||||||
end
|
end
|
||||||
|
|
||||||
# 1Password → env vars (single op call, silent if locked)
|
# 1Password → env vars (single op call, silent on failure)
|
||||||
function op-env --description "Load secrets from 1Password"
|
function op-env --description "Load secrets from 1Password"
|
||||||
if not type -q op; or not test -f ${envTpl}
|
if not type -q op; or not test -f ${envTpl}
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
for line in (op inject < ${envTpl} 2>/dev/null)
|
set -l output (op inject --in-file ${envTpl} 2>/dev/null)
|
||||||
|
or return 1
|
||||||
|
for line in $output
|
||||||
string match -qr '^\s*(#|$)' -- $line; and continue
|
string match -qr '^\s*(#|$)' -- $line; and continue
|
||||||
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
|
||||||
|
|||||||
@@ -86,6 +86,7 @@
|
|||||||
"raycast"
|
"raycast"
|
||||||
"spotify"
|
"spotify"
|
||||||
"telegram-desktop"
|
"telegram-desktop"
|
||||||
|
"tencent-meeting"
|
||||||
"termius"
|
"termius"
|
||||||
"visual-studio-code"
|
"visual-studio-code"
|
||||||
"wechat"
|
"wechat"
|
||||||
|
|||||||
Reference in New Issue
Block a user