Skip to content

Commit 951866a

Browse files
Clément POIRETtesujimath
andauthored
Fix $in type for nushell v0.102+ (#46)
This commit fixes an issue where Nushell v0.102 raises an error because `$in` is possibly undefined. Fixes #45 --------- Co-authored-by: Simon Guest <simon.guest@tesujimath.org>
1 parent 23d30cb commit 951866a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

bash-env.nu

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ export def main [
1616
[]
1717
}
1818

19-
let raw = ($in | str join "\n") | bash-env-json ...($fn_args ++ $path_args) | complete
19+
let input_str = $in | default "" | str join "\n"
20+
let raw = $input_str | bash-env-json ...($fn_args ++ $path_args) | complete
2021
let raw_json = $raw.stdout | from json
2122

2223
let error = $raw_json | get -i error

0 commit comments

Comments
 (0)