auto-expand paths in the $nu variable#8653
Merged
fdncred merged 1 commit intonushell:mainfrom Mar 29, 2023
Merged
Conversation
Contributor
Author
|
@amtoine - if this lands, it'll allow us to take some of the |
amtoine
approved these changes
Mar 29, 2023
Member
amtoine
left a comment
There was a problem hiding this comment.
@amtoine - if this lands, it'll allow us to take some of the
path expands off of the stdlib where it was failing previously on macos.
i won't be able to reproduce this i fear, 'cause i never had this issue on my linux machine...
but that looks great and yeah, for sure we can simplify the tests once it lands 👍
amtoine
added a commit
to amtoine/nushell
that referenced
this pull request
Mar 29, 2023
This should have been fixed in nushell#8653.
Contributor
|
Looks like this breaks the |
fdncred
added a commit
that referenced
this pull request
Mar 31, 2023
# Description This PR fixes a testing bug that @rgwood found and PR #8653 introduced, mentioned [here](#8653 (comment)). Since 8653 returns canonicalizes config paths now, the tests need to return canonicalized paths as well. Without this PR, if you have your nushell config dir symlinked, this test will fail. This PR fixes that test. # User-Facing Changes # Tests + Formatting Don't forget to add tests that cover your changes. 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 -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass - `cargo run -- crates/nu-utils/standard_library/tests.nu` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` # After Submitting If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
I recently ran into an issue where one of the $nu paths was not expanded and was causing issue because $env.PWD did not equal $nu.temp-path, even though I was in $nu.temp-path. The reason it didn't match was because my temp path was symlinked. This PR fixes that issue by expanding the paths with canonicalize_with().
User-Facing Changes
Tests + Formatting
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
cargo fmt --all -- --checkto check standard code formatting (cargo fmt --allapplies these changes)cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collectto check that you're using the standard code stylecargo test --workspaceto check that all tests passAfter Submitting
If your PR had any user-facing changes, update the documentation after the PR is merged, if necessary. This will help us keep the docs up to date.