-
Notifications
You must be signed in to change notification settings - Fork 12
Adding windows support for install_stub #21
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
base: main
Are you sure you want to change the base?
Conversation
I haven't tested this logic, as I am not sure how this is done with GitHub CLI extensions. Just wanted to offer some assistance with this feature. If one of the maintainers can help with running a test, it would be much appreciated. Also, not sure why it is failing the status check, it seems to be downloading some really old 2.6.1 database and throwing some internal CodeQL CLI failure. Would love to get some feedback on these points, thanks in advance! |
Thanks for the contribution! Looks like we're hard-coding a bunch of version numbers in the test and the older version being used is no longer able to run modern queries. I could just change the versions to something more recent, but better would be to get the latest and second latest versions for these tests. |
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.
This looks reasonable to me, but I have no way of testing this. Have you tried this out? On MacOS, the extension live in $HOME/.local/share/gh/extensions/gh-codeql
. I expect it's similar on windows. I think the best thing to do is manually edit the gh-codeql
file to see if it works.
And if you rebase this PR on top of mine, it will be passing.
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.
@aeisenberg sorry for necroreviewing 😆 maybe we can pick this up? I was just trying to understand if install_stub
works on Windows and I stumbled on this. It might be nice to pick this up at a certain point. Maybe I'll give it a spin for a test.
|
||
cat << "_codeql_stub" > "$bindir/codeql" | ||
gh codeql %* |
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.
we should add an exit /b %ERRORLEVEL%
line, otherwise a command failure gets lost
gh codeql %* | ||
_codeql_stub | ||
|
||
chmod +x "$bindir/codeql.cmd" |
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.
I don't think this is required for Windows batch files
@redsun82, that would be great. I have no way to test this easily. If you want to take this over and merge when you're comfortable, I would 100% support that. |
We should be able to test this in an Action workflow using a Windows runner. |
Adding option to install stub for windows (codeql.cmd) so that windows users can use this GitHub managed CLI directly within the terminal or VSCode.