Skip to content

Commit

Permalink
fix nushell v0.87.0 (#71)
Browse files Browse the repository at this point in the history
use `def --env` instead of deprecated `def-env`  and support launching files

https://www.nushell.sh/blog/2023-11-14-nushell_0_87_0.html#deprecated-commands-toc
  • Loading branch information
Araxeus authored Jun 1, 2024
1 parent cec71a6 commit 82049cf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/lsi.nu
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# add the following function to env.nu
# you can open env.nu in nushell with `config env`

def-env lsi [...path: string] {
def --env lsi [...path: string] {
let output = (ls-interactive ($path | str join ' '))
cd (
if ($output | is-empty) { $env.PWD }
else { $output }
)
if ($output | is-empty) { return }
if (($output | path type) == 'file') {
start $output # replace with your preferred editor
} else { cd $output }
}

0 comments on commit 82049cf

Please sign in to comment.