Skip to content

Commit

Permalink
quitcd: nushell use regex to remove single quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
BeyondMagic committed May 27, 2024
1 parent 71452fa commit 498d617
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions misc/quitcd/quitcd.nu
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 498d617

Please sign in to comment.