-
Notifications
You must be signed in to change notification settings - Fork 55
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
feat(windows) powershell and batch support #45
feat(windows) powershell and batch support #45
Conversation
@tensor-programming thanks so much for the PR! I'll be able to review it this week, only peaked so far. Adding Windows CI is amazing 👍 |
Not a problem. Probably going to refactor some of the Powershell stuff in the tests just to make it a little more consistent. |
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.
Great PR! Such minimal changes to get full Windows support 😄
Left a few comment questions. After they're answered, I'll approve, merge and release 👍
Co-Authored-By: Jake Deichert <[email protected]>
Alright, everything should be good to go. |
@tensor-programming thanks! Just one more question ^^ and then we'll get this merged and deployed 👍 |
Resolved it. Stemmed from an unnecessary misunderstanding of how mask and powershell dealt with shortcase flags. |
@tensor-programming thanks! Yeah, that's why I was confused since mask only passes in the long form name :) I'll try to merge and deploy tonight or tomorrow night 👍 |
Ouff, i'm going to have to revert the merge for a bit. On macOS, mask is now broken and throwing this error:
|
@tensor-programming when you have a min, can you make a new PR from your branch to master, just like this. I apparently can't reopen a merged PR 😓 I'll debug and figure out the macOS issue introduced by this 👍 Planning to get this re-merged and published this weekend 🤞 |
Sorry, I just restored the branch and added a new PR. |
Which issue does this fix?
Closes #10
Describe the solution
Added batch and powershell scripting for windows.
Powershell worked out of the box with some minor idiosyncrasies (more on that in a moment) and batch just required a new match statement for the runtime. CFG was used for batch and for a few of the tests. Each instance of shell/bash in the tests and maskfile.md was given a complimentary powershell script as well. On the Linux/WSL side, had to make some changes to the parser because it didn't ignore the powershell and batch blocks. Used CFG to change the way the parser matches on codeblock tags.
Regarding Powershell: normally when using powershell you are not allowed to pass double hyphen flags
--
to a script. This somewhat dubious choice doesn't seem to affect mask since the arguments are passed into the environment. If you pass a flag x as such--x
you are able to gain access to the value of the flag via$env:x
. This works out nicely because there doesn't need to be two separate CLI interfaces for windows and Linux.The Paths in windows are proceeded by
\\?\
, for instance:\\?\C:\\path\\to\\maskfile.md
. If this prefix is removed from the path, it will work without issue in Mask/Rust. Only had to do this one time and it was done via Powershell.Edit: one more thing worth mentioning is that I am not the most experienced powershell dev. I tried to make all of the blocks consistent but there are a few items that might not be completely idiomatic.