Skip to content

Commit

Permalink
v2.0.4 (#92)
Browse files Browse the repository at this point in the history
Minor updates
* Handle errors correctly when running a script file
  • Loading branch information
bfren authored Nov 27, 2023
1 parent f969af7 commit 6070327
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.3
2.0.4
4 changes: 3 additions & 1 deletion overlay/etc/nu/scripts/bf/x.nu
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use dump.nu
use handle.nu

# Set BF_X to the name of the script and then execute it
export def main [
Expand All @@ -8,5 +9,6 @@ export def main [
let name = if ($path | str length) > 15 { $path | path basename } else { $path }

# set X variable and execute
with-env {BF_X: $name} { ^nu $path }
let on_failure = {|code, err| print --no-newline --stderr $err ; exit $code }
{ with-env [BF_X $name] { ^nu $path } } | handle x -f $on_failure
}

0 comments on commit 6070327

Please sign in to comment.