-
Notifications
You must be signed in to change notification settings - Fork 2.1k
scripts can't operate as part of a pipeline #9373
Copy link
Copy link
Open
Labels
status:needs-designthis feature requires designthis feature requires designusage:script-fileIssues related to executing a script file (as opposed to a module or sourcing)Issues related to executing a script file (as opposed to a module or sourcing)
Description
Describe the bug
with a simple script that returns a simple data structure, it does not appear as true data in the REPL 🤔
How to reproduce
- in
foo.nu, put the following
let prs = [
[foo bar];
[1 2]
[3 4]
]
$prs- run the script with
nu foo.nu
=> this will show the table as expected - run the script as
nu foo.nu | columns
Error: nu::shell::only_supports_this_input_type
× Input type not supported.
╭─[entry #4:1:1]
1 │ nu foo.nu | columns
· ─┬ ───┬───
· │ ╰── only record or table input data is supported
· ╰── input type: raw data
╰────
- run the script as
nu foo.nu | get 0
Error: nu::shell::io_error
× I/O error
help: can't follow stream paths
- and finally
nu foo.nu | select foodoes not give anything...
👉 looks like foo.nu is returning some strange output 🤔
Expected behavior
i expected nu foo.nu to return the table as-is, allowing all the classic operations on tables.
Note
i get the exact same behaviour with the following more explicit scriptdef main [] { let prs = [ [foo bar]; [1 2] [3 4] ] return $prs }
Screenshots
No response
Configuration
| key | value |
|---|---|
| version | 0.80.1 |
| branch | main |
| commit_hash | acd2fe8 |
| build_os | linux-x86_64 |
| build_target | x86_64-unknown-linux-gnu |
| rust_version | rustc 1.68.2 (9eb3afe9e 2023-03-27) |
| rust_channel | 1.68.2-x86_64-unknown-linux-gnu |
| cargo_version | cargo 1.68.2 (6feb7c9cf 2023-03-26) |
| build_time | 2023-06-03 13:10:15 +02:00 |
| build_rust_channel | release |
| features | default, sqlite, trash, which, zip |
| installed_plugins |
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
status:needs-designthis feature requires designthis feature requires designusage:script-fileIssues related to executing a script file (as opposed to a module or sourcing)Issues related to executing a script file (as opposed to a module or sourcing)