Skip to content

Commit

Permalink
yazi: rename shell wrappers from ya to yy
Browse files Browse the repository at this point in the history
The program shell wrappers have been renamed from `ya` to `yy` since the
introduction of the new CLI tool, which took the name of `ya`.

For more information, see sxyazi/yazi#914

Co-authored-by: XYenon <[email protected]>
  • Loading branch information
eljamm and XYenon committed Jun 24, 2024
1 parent ea50e1a commit 8ed11aa
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
8 changes: 8 additions & 0 deletions modules/misc/news.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1679,6 +1679,14 @@ in {
https://github.com/rafaelmardojai/blanket for more.
'';
}

{
time = "2024-06-23T14:34:28+00:00";
condition = with config.programs.yazi; enable && (enableBashIntegration || enableZshIntegration || enableFishIntegration || enableNushellIntegration);
message = ''
Yazi's shell integration wrappers have been renamed from 'ya' to 'yy'.
'';
}
];
};
}
6 changes: 3 additions & 3 deletions modules/programs/yazi.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let
tomlFormat = pkgs.formats.toml { };

bashIntegration = ''
function ya() {
function yy() {
local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
yazi "$@" --cwd-file="$tmp"
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
Expand All @@ -18,7 +18,7 @@ let
'';

fishIntegration = ''
function ya
function yy
set tmp (mktemp -t "yazi-cwd.XXXXX")
yazi $argv --cwd-file="$tmp"
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
Expand All @@ -29,7 +29,7 @@ let
'';

nushellIntegration = ''
def --env ya [...args] {
def --env yy [...args] {
let tmp = (mktemp -t "yazi-cwd.XXXXX")
yazi ...$args --cwd-file $tmp
let cwd = (open $tmp)
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/programs/yazi/bash-integration-enabled.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

let
shellIntegration = ''
function ya() {
function yy() {
local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
yazi "$@" --cwd-file="$tmp"
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/programs/yazi/fish-integration-enabled.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

let
shellIntegration = ''
function ya
function yy
set tmp (mktemp -t "yazi-cwd.XXXXX")
yazi $argv --cwd-file="$tmp"
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

let
shellIntegration = ''
def --env ya [...args] {
def --env yy [...args] {
let tmp = (mktemp -t "yazi-cwd.XXXXX")
yazi ...$args --cwd-file $tmp
let cwd = (open $tmp)
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/programs/yazi/zsh-integration-enabled.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

let
shellIntegration = ''
function ya() {
function yy() {
local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
yazi "$@" --cwd-file="$tmp"
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
Expand Down

0 comments on commit 8ed11aa

Please sign in to comment.