Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed the issue for powershell env variable #910

Closed
wants to merge 1 commit into from

Conversation

rajiknows
Copy link

@rajiknows rajiknows commented Oct 7, 2024

addressing issue #906

added the conditional check in powershell.txt

@rajiknows
Copy link
Author

lint errors can be neglected , it just rearranged the imports due to cargo fmt , which was on by default on my machine .

@rajiknows rajiknows closed this Oct 7, 2024
@rajiknows rajiknows reopened this Oct 7, 2024
@rajiknows rajiknows closed this Oct 7, 2024
@rajiknows rajiknows reopened this Oct 7, 2024

if ($dir.StartsWith('%') -and $dir.EndsWith('%')) {
$envVar = $dir.Trim('%')
$dir = $env:$envVar
Copy link

@WiIIiamWei WiIIiamWei Oct 7, 2024

Choose a reason for hiding this comment

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

I've tested on this, but your code seems to be generating errors when I load the profile on my machine.

I think you meant to write this at 33:

        $dir = ${env:$envVar}

I tried to fix this too and comes up with a different approach (at #911), which might be covering more cases than your solution. Looking for reviews too.

Copy link
Author

Choose a reason for hiding this comment

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

Upon reviewing the repository locally on my machine, I realized the fix could be related to the powershell.txt file, specifically within the __zoxide_cd function, but since I'm currently working on a Linux machine, I wasn't able to test it. I apologize for submitting the PR without proper testing.

@ajeetdsouza
Copy link
Owner

As mentioned in the issue - this is a CMD.EXE feature, not a PowerShell feature.

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.

3 participants