-
Notifications
You must be signed in to change notification settings - Fork 479
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
Fix powershell shebang, closes #825 #826
Conversation
Thanks for the PR! Can you add a test that this works on windows? Check out the Also, what if the users writes:
…without Even though this is windows specific, let's do it on every platform. The less platform-specific code there is the better, and it won't hurt to add a |
src/recipe.rs
Outdated
@@ -115,7 +127,8 @@ impl<'src, D> Recipe<'src, D> { | |||
io_error: error, | |||
})?; | |||
let mut path = tmp.path().to_path_buf(); | |||
path.push(self.name()); | |||
let suffix = Platform::get_script_file_suffix(interpreter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this isn't platform specific, we can just inline it:
let suffix = Platform::get_script_file_suffix(interpreter); | |
let suffix = if command.ends_with("powershell") | |
|| command.ends_with("powershell.exe") | |
{ | |
".ps1" | |
} else { | |
"" | |
}; |
I made an additional suggestion. We can move the suffix function out of |
Head branch was pushed to by a user without write access
Thanks again for the PR! Let me know if you'd like me to cut a release of Just that contains the new code. |
No description provided.