Skip to content

Change parser cwd when running a file#7134

Merged
kubouch merged 3 commits intonushell:mainfrom
kubouch:nu-file-cwd
Nov 14, 2022
Merged

Change parser cwd when running a file#7134
kubouch merged 3 commits intonushell:mainfrom
kubouch:nu-file-cwd

Conversation

@kubouch
Copy link
Copy Markdown
Contributor

@kubouch kubouch commented Nov 14, 2022

Description

Previously, when running nu spam.nu, the currently parsed CWD was not set in the parser, so if the file included statements like use mod.nu, the mod.nu would not be looked up as file-relative. This PR fixes that.

Major Changes

None

Tests + Formatting

Make sure you've done the following, if applicable:

  • Add tests that cover your changes (either in the command examples, the crate/tests folder, or in the /tests folder)
    • Try to think about corner cases and various ways how your changes could break. Cover those in the tests

Make sure you've run and fixed any issues with these commands:

  • cargo fmt --all -- --check to check standard code formatting (cargo fmt --all applies these changes)
  • cargo clippy --workspace --features=extra -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect to check that you're using the standard code style
  • cargo test --workspace --features=extra to check that all tests pass

After Submitting

  • Help us keep the docs up to date: If your PR affects the user experience of Nushell (adding/removing a command, changing an input/output type, etc.), make sure the changes are reflected in the documentation (https://github.com/nushell/nushell.github.io) after the PR is merged.

@kubouch kubouch marked this pull request as ready for review November 14, 2022 22:20
@kubouch kubouch merged commit 81b12d0 into nushell:main Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant