From 71452faa400ed1a911c933a23b13937771ce2ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20F=2E=20=28BeyondMagic/koetemagie=29?= Date: Sun, 26 May 2024 23:05:14 -0300 Subject: [PATCH 1/2] quitcd: fix range limits for new nushell version --- misc/quitcd/quitcd.nu | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/misc/quitcd/quitcd.nu b/misc/quitcd/quitcd.nu index c2211b65..129c3d3d 100644 --- a/misc/quitcd/quitcd.nu +++ b/misc/quitcd/quitcd.nu @@ -28,7 +28,10 @@ export def --env n [ if ($nnn_tmpfile | path exists) { # Remove from the first part of the string and the last single quote <'>. # Fix post-processing of nnn's given path that escapes its single quotes with POSIX syntax. - let path = open $nnn_tmpfile | str substring 4..-1 | str replace --all `'\''` `'` + let path = open $nnn_tmpfile + | str substring 3.. + | str trim --char "'" + | str replace --all `'\''` `'` ^rm -- $nnn_tmpfile From 498d61763992ddbe1395b93bc5eb63df787efd90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20F=2E=20=28BeyondMagic/koetemagie=29?= Date: Mon, 27 May 2024 11:16:36 -0300 Subject: [PATCH 2/2] quitcd: nushell use regex to remove single quotes --- misc/quitcd/quitcd.nu | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/misc/quitcd/quitcd.nu b/misc/quitcd/quitcd.nu index 129c3d3d..fe0d85a7 100644 --- a/misc/quitcd/quitcd.nu +++ b/misc/quitcd/quitcd.nu @@ -29,8 +29,7 @@ export def --env n [ # Remove from the first part of the string and the last single quote <'>. # Fix post-processing of nnn's given path that escapes its single quotes with POSIX syntax. let path = open $nnn_tmpfile - | str substring 3.. - | str trim --char "'" + | str replace --all --regex `^cd '|'$` `` | str replace --all `'\''` `'` ^rm -- $nnn_tmpfile