1
0
Fork 0
forked from mirror/nnn

quitcd: nushell use regex to remove single quotes

This commit is contained in:
João F. (BeyondMagic/koetemagie) 2024-05-27 11:16:36 -03:00
parent 71452faa40
commit 498d617639

View file

@ -29,8 +29,7 @@ export def --env n [
# Remove <cd '> 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