Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Add a PowerShell wrapper #58

Merged
merged 1 commit into from
Jan 26, 2024
Merged

Add a PowerShell wrapper #58

merged 1 commit into from
Jan 26, 2024

Conversation

FantasqueX
Copy link
Contributor

@FantasqueX FantasqueX commented Jan 19, 2024

PowerShell is a modern command line shell for Windows. This patch adds a PowerShell wrapper. This version is more maintainable than bat version. There are some difference with existing bat wrapper. First, Downloaded mill is stored in $Env:LOCALAPPDATA\mill instead of $Env:%USERPROFILE%\.mill because according to
https://en.wikipedia.org/wiki/Environment_variable#Windows, %LOCALAPPDATA% is the temporary files of Applications. And folder starting with "." is not hidden in Windows. Second, argument to set mill version is changed to -MillVersion to follow PowerShell converion, just like -RelativeBasePath of Resolve-Path
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/resolve-path.

@FantasqueX FantasqueX force-pushed the pwsh-1 branch 2 times, most recently from 0f9415c to f9f25c6 Compare January 20, 2024 19:12
@lefou
Copy link
Owner

lefou commented Jan 22, 2024

Thank you for this contribution. Is it necessary for the script to work, that you renamed the --mill-version option to -MillVersion? Beside the fact, that this option might die in the future, since it breaks the "transparent" wrapper experience with Mill (and there are alternatives via the env variables), I think we should try to keep it the same as in all other wrapper scripts. Also, to make it easier to write tooling around it (like Metals), which can just use the same options, disregarding of the currently used platform or user preference.

@FantasqueX
Copy link
Contributor Author

PowerShell does not support double dash parameter out of box PowerShell/PowerShell#16749

I'll change the patch to manually parse parameters just like sh script later.

PowerShell is a modern command line shell for Windows. This patch adds a
PowerShell wrapper. This version is more maintainable than bat version.
There are some difference with existing bat wrapper. First, Downloaded
mill is stored in `$Env:LOCALAPPDATA\mill` instead of `$Env:%USERPROFILE%\.mill`
because according to
https://en.wikipedia.org/wiki/Environment_variable#Windows, `%LOCALAPPDATA%`
is the temporary files of Applications. And folder starting with "." is
not hidden in Windows. Second, argument to set mill version is changed
to `-MillVersion` to follow PowerShell converion, just like
`-RelativeBasePath` of `Resolve-Path`
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/resolve-path.
@FantasqueX
Copy link
Contributor Author

Hi, I have pushed a fix @lefou

@lefou
Copy link
Owner

lefou commented Jan 26, 2024

Thank you, @FantasqueX

@lefou lefou merged commit 0e979ae into lefou:main Jan 26, 2024
1 check passed
@lefou lefou added this to the 0.4.12 milestone Jan 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants