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

add executable to the shell trait and implement it #224

Merged
merged 7 commits into from
Jun 22, 2023

Conversation

ruben-arts
Copy link
Collaborator

Add executable so it can be used to find the command that needs to be run.

@@ -244,9 +263,12 @@ impl Shell for PowerShell {
fn extension(&self) -> &str {
"ps1"
}
fn executable(&self) -> &str {
"powershell"
Copy link
Contributor

Choose a reason for hiding this comment

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

pwsh[.exe] is the executable file name of PowerShell [Core] (v6+), the cross-platform edition of PowerShell built on .NET Core / .NET 5+; by contrast, powershell.exe is the executable name of the legacy Windows PowerShell edition (v5.1-), built on the Windows-only .NET Framework (v4.8-)

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use pwsh? cc @baszalmstra

@@ -244,9 +263,12 @@ impl Shell for PowerShell {
fn extension(&self) -> &str {
"ps1"
}
fn executable(&self) -> &str {
"powershell"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use pwsh? cc @baszalmstra

@wolfv
Copy link
Contributor

wolfv commented Jun 21, 2023

The other option would be that inside the executable function we execute which and check wether pwsh or powershell is available on the PATH.

@wolfv
Copy link
Contributor

wolfv commented Jun 21, 2023

https://github.com/harryfei/which-rs something like this

@baszalmstra
Copy link
Collaborator

what does micromamba do?

@wolfv
Copy link
Contributor

wolfv commented Jun 21, 2023

i don't think we have soemthing like thsi for micromamba. We'd use whatever the user supplies (or parent process) for the shell.

For initialization we iterate through pwsh and powershell and initialize both.

@wolfv wolfv merged commit f89bb21 into conda:main Jun 22, 2023
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