mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 21:36:42 +00:00
quitcd: nushell use regex to remove single quotes
This commit is contained in:
parent
71452faa40
commit
498d617639
|
@ -29,8 +29,7 @@ export def --env n [
|
||||||
# Remove <cd '> from the first part of the string and the last single quote <'>.
|
# 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.
|
# Fix post-processing of nnn's given path that escapes its single quotes with POSIX syntax.
|
||||||
let path = open $nnn_tmpfile
|
let path = open $nnn_tmpfile
|
||||||
| str substring 3..
|
| str replace --all --regex `^cd '|'$` ``
|
||||||
| str trim --char "'"
|
|
||||||
| str replace --all `'\''` `'`
|
| str replace --all `'\''` `'`
|
||||||
|
|
||||||
^rm -- $nnn_tmpfile
|
^rm -- $nnn_tmpfile
|
||||||
|
|
Loading…
Reference in a new issue