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

Use ps1 extension for pwsh shebangs #1027

Merged
merged 2 commits into from
Nov 17, 2021
Merged

Use ps1 extension for pwsh shebangs #1027

merged 2 commits into from
Nov 17, 2021

Conversation

dmringo
Copy link
Contributor

@dmringo dmringo commented Nov 15, 2021

As of PowerShell/PowerShell#15859, which is in PowerShell Core 7.2, pwsh.exe requires a ps1 extension for -File arguments on Windows. This "works on my (Win 10) machine" but I know very little about PowerShell and even less about Rust. Not sure if it's worth trying to make Just's behavior here Windows-specific.

@casey
Copy link
Owner

casey commented Nov 17, 2021

Looks good to me! Could you add a test? No worries if not, I can add it. It should be really easy, just copy the powershell_script_filename test in the same file twice, give them new names, and test the cases you added.

@dmringo
Copy link
Contributor Author

dmringo commented Nov 17, 2021

Looks good to me! Could you add a test? No worries if not, I can add it. It should be really easy, just copy the powershell_script_filename test in the same file twice, give them new names, and test the cases you added.

Done!

I was tempted to join the powershell filename tests together (like the various check calls in split_shebang) but maybe it's better to keep them separate to have well-named tests. Is the #test annotation something you can abstract over in Rust?

Thanks for all your work on this project. just is near the top of my most used (and loved) CLI tools.

@casey
Copy link
Owner

casey commented Nov 17, 2021

Done!

Awesome!

I was tempted to join the powershell filename tests together (like the various check calls in split_shebang) but maybe it's better to keep them separate to have well-named tests. Is the #test annotation something you can abstract over in Rust?

I think separate well-named tests is good. You can abstract over the test annotation using macros, but it winds up being a little gross. I'm actually moving away from having macros that generate tests, the tests in the tests directory are mixed, some use macros, some don't.

Thanks for all your work on this project. just is near the top of my most used (and loved) CLI tools.

You bet! That's great to hear.

@casey casey enabled auto-merge (squash) November 17, 2021 04:18
@casey casey merged commit 53d3c75 into casey:master Nov 17, 2021
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.

2 participants