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

Activation with powershell scripts opens file instead of executing it #551

Closed
2 tasks done
melund opened this issue Dec 7, 2023 · 4 comments
Closed
2 tasks done
Labels
🐞 bug Something isn't working

Comments

@melund
Copy link

melund commented Dec 7, 2023

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

On Windnows add an activation section to pixi.toml

[activation]
scripts = ["setup.ps1"]

Create a setup.ps1 with any content.

$env:MY_ENV_VAR="Hello World"

Now activate the shell:

PS> pixi shell

This opens the setup.ps1 file in NotePad, instead of executing it. Shell activation hangs until the file is closed.

Issue description

On Windows activations using powershell scripts doesn't work. They open the script file in Notepad instead of executing it.

image

Using *.bat files works fine as workaround.

Expected behavior

The powershell script should run.

@melund melund added the 🐞 bug Something isn't working label Dec 7, 2023
@ruben-arts
Copy link
Contributor

The problem is that we need to run the activation scripts using the system shell interpreters so as of right now we use the default shells so we always know it will be available. This is cmd.exe on windows and bash on Unix. This makes it that it can't run the .ps1 files.

For now I'll update the documentation to explain this behavior. Would that be enough for you?

baszalmstra pushed a commit that referenced this issue Dec 11, 2023
Hopefully helping the users with confusion around the activation
scripts.

Related issue: #551
@melund
Copy link
Author

melund commented Dec 11, 2023

For now I'll update the documentation to explain this behavior. Would that be enough for you?

Yes . Of course :) Documentation just hinted that it had or was supposed to work.

Screenshot_20231211-170831.png

@ruben-arts
Copy link
Contributor

Oops haha, that was a mistake!

@ruben-arts
Copy link
Contributor

Fixed in : #563

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants