Skip to content

Fix config {nu,env} to open $nu.{config,env}-file - #8792

Merged
sholderbach merged 2 commits into
nushell:mainfrom
ito-hiroki:fix/8755/config-ref-file
Apr 7, 2023
Merged

sholderbach merged 2 commits into
nushell:mainfrom
ito-hiroki:fix/8755/config-ref-file

Conversation

@ito-hiroki

Copy link
Copy Markdown
Contributor

Description

fixed #8755
Now, command config {nu,env} opens default file .config/nushell/{config,env}.nu.
This behavior is inappropriate when nu is launched with option --config or --env-config.
This PR changes the file that the command opens to $nu.{config,env}-file.

User-Facing Changes

config {nu,env} opens $nu.{config,env}-file.

Tests + Formatting

- :green_circle: `toolkit fmt`
- :green_circle: `toolkit clippy`
- :green_circle: `toolkit test`
- :red_circle: `toolkit test stdlib`

I got these errors, but the errors are probably caused by my environment.

INF|2023-04-07T23:30:00.382|Running tests in test_asserts
Error:
  × ASSERT:SKIP
    ╭─[std.nu:75:1]
 75 │ export def "assert skip" [] {
 76 │     error make {msg: "ASSERT:SKIP"}
    ·     ─────┬────
    ·          ╰── originates from here
 77 │ }
    ╰────


INF|2023-04-07T23:30:00.642|Running tests in test_dirs
INF|2023-04-07T23:30:00.819|Running tests in test_logger
INF|2023-04-07T23:30:01.125|Running tests in test_std
INF|2023-04-07T23:30:01.186|Running tests in test_xml
Error: nu::shell::deprecated_command

  × Deprecated command match
     ╭─[std.nu:421:1]
 421 │     for $step in ($path) {
 422 │         match ($step | describe) {
     ·         ──┬──
     ·           ╰── 'match' is deprecated. Please use 'find' instead.
 423 │             'string' => {
     ╰────

Error: nu::shell::deprecated_command

  × Deprecated command match
     ╭─[std.nu:518:1]
 518 │
 519 │         match ($step | describe) {
     ·         ──┬──
     ·           ╰── 'match' is deprecated. Please use 'find' instead.
 520 │             'string' => {
     ╰────

Error: nu::shell::deprecated_command

  × Deprecated command match
     ╭─[std.nu:518:1]
 518 │
 519 │         match ($step | describe) {
     ·         ──┬──
     ·           ╰── 'match' is deprecated. Please use 'find' instead.
 520 │             'string' => {
     ╰────

After Submitting

nothing

@ito-hiroki ito-hiroki changed the title Fix/8755/config ref file hanges the file that the command opens to $nu.{config,env}-file Apr 7, 2023
@ito-hiroki ito-hiroki changed the title hanges the file that the command opens to $nu.{config,env}-file Cange a file that config {nu,env} opens to $nu.{config,env}-file Apr 7, 2023

@sholderbach sholderbach left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix! Looks good!

@ito-hiroki ito-hiroki changed the title Cange a file that config {nu,env} opens to $nu.{config,env}-file Fix config {nu,env} to open $nu.{config,env}-file Apr 7, 2023
@sholderbach
sholderbach merged commit a3ea0c3 into nushell:main Apr 7, 2023
@JadoJodo

JadoJodo commented Apr 7, 2023

Copy link
Copy Markdown

Thanks all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notes:breaking-changes Noted in Breaking Changes section

Projects

None yet

Development

Successfully merging this pull request may close these issues.

config env/config nu opens the default file

4 participants