Skip to content

make_docs.nu appears to be broken #850

@amtoine

Description

@amtoine

i wanted to see the website with the new additions and found a few bugs in the make_docs.nu script 😮

1. closure parsing

with the new {|| ...} required syntax, we get

Error: nu::parser::closure_missing_pipe

  × Missing || inside closure
     ╭─[/home/amtoine/.local/share/git/store/github.com/amtoine/nushell.github.io/make_docs.nu:245:1]
 245 │       $unique_categories
 246 │         | each { safe-path }
     ·                ──────┬──────
     ·                      ╰── Parsing as a closure, but || is missing
 247 │         | each { |category| $"  '/commands/categories/($category).md',"}
     ╰────
  help: Try add || to the beginning of closure

this is an easy fix 👍

2. the script does not work (see error at the bottom)

this is because of the new

  Create a more complex custom error
  > error make {
        msg: "my custom error message"
        label: {
            text: "my custom label text"  # not mandatory unless $.label exists
            start: 123  # not mandatory unless $.label.end is set
            end: 456  # not mandatory unless $.label.start is set
        }
    }

example of error make...

it crashes the script on line 167 in the command-doc command 🤔

not sure what the best to do is here 😕

the actual error

Error: nu::shell::eval_block_with_input

  × Eval block failed with pipeline input
     ╭─[/home/amtoine/.local/share/git/store/github.com/amtoine/nushell.github.io/make_docs.nu:312:1]
 312 │     let commands_group = ($commands | group-by name)
 313 │     let unique_commands = ($commands_group | columns)
     ·                                              ───┬───
     ·                                                 ╰── source value
 314 │     let unique_categories = ($commands | get category | uniq)
     ╰────

Error: nu::shell::eval_block_with_input

  × Eval block failed with pipeline input
     ╭─[/home/amtoine/.local/share/git/store/github.com/amtoine/nushell.github.io/make_docs.nu:307:1]
 307 │     let commands = (
 308 │         $nu.scope.commands
     ·         ─┬─
     ·          ╰── source value
 309 │         | where is_custom == false and is_extern == false
     ╰────

Error: nu::shell::eval_block_with_input

  × Eval block failed with pipeline input
     ╭─[/home/amtoine/.local/share/git/store/github.com/amtoine/nushell.github.io/make_docs.nu:307:1]
 307 │     let commands = (
 308 │         $nu.scope.commands
     ·         ─┬─
     ·          ╰── source value
 309 │         | where is_custom == false and is_extern == false
     ╰────

Error:
  × my custom error message

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions