Skip to content

register does not accept true constant arguments #8208

Closed

Description

@amtoine

Related problem

i've got the nu_plugin_query from nushell installed in my $env.CARGO_HOME/bin/ which is ~/.local/share/cargo/bin/

i can not define a constant with the full absolute path and register from the constant

>_ const foo = "/home/amtoine/.local/share/cargo/bin/nu_plugin_query"
>_ register $foo
Error: nu::parser::registered_file_not_found

  × File not found
   ╭─[entry #14:1:1]
 1 │ register $foo
   ·          ──┬─
   ·            ╰── File not found: $foo
   ╰────
  help: registered files need to be available before your script is run

Note
see the original discussion over on Discord

Describe the solution you'd like

i would like

>_ const foo = "/home/amtoine/.local/share/cargo/bin/nu_plugin_query"
>_ register $foo

to register the plugin as just as register ~/.local/share/cargo/bin/nu_plugin_query already does 😋

Describe alternatives you've considered

No response

Additional context and details

No response

Activity

  1. added
    category:enhancement
    on Feb 25, 2023
  2. added
    deprecated:pr-plugins
    on Feb 25, 2023
  3. fdncred commented on Feb 25, 2023

    @fdncred
    Contributor

    After researching this and Kubouch's wisdom, it appears that eval_constant() needs to be used in parse_register() in parse_keywords.rs similar to the way it's used in other parsing functions in that file.

  4. added
    A:parser
    on Feb 25, 2023
  5. added a commit that references this issue on Apr 8, 2023
    637283f
  6. added this to the v0.79.0 milestone on Apr 11, 2023
  7. added a commit that references this issue on Apr 12, 2023
    2393d2e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:parsercategory:enhancementdeprecated:pr-plugins

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions