mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
yazi: update wrappers not to use cat in subshell
If cat is aliased to bat the non piping operation in the script might include extra text, use builtins instead
This commit is contained in:
parent
6feb368511
commit
65bf99c579
2 changed files with 3 additions and 3 deletions
|
|
@ -221,7 +221,7 @@ in
|
|||
function ${cfg.shellWrapperName}() {
|
||||
local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
||||
yazi "$@" --cwd-file="$tmp"
|
||||
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
||||
if cwd="$(<"$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
||||
builtin cd -- "$cwd"
|
||||
fi
|
||||
rm -f -- "$tmp"
|
||||
|
|
@ -231,7 +231,7 @@ in
|
|||
fishIntegration = ''
|
||||
set -l tmp (mktemp -t "yazi-cwd.XXXXX")
|
||||
command yazi $argv --cwd-file="$tmp"
|
||||
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
|
||||
if read cwd < "$tmp"; and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
|
||||
builtin cd -- "$cwd"
|
||||
end
|
||||
rm -f -- "$tmp"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
function yy
|
||||
set -l tmp (mktemp -t "yazi-cwd.XXXXX")
|
||||
command yazi $argv --cwd-file="$tmp"
|
||||
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
|
||||
if read cwd <"$tmp"; and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
|
||||
builtin cd -- "$cwd"
|
||||
end
|
||||
rm -f -- "$tmp"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue