-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 CLI formatting on windows #119435
Fix CLI formatting on windows #119435
Conversation
ACK: reviewing... |
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.
Looks and works as expected, thanks!
* Side Public License, v 1. | ||
*/ | ||
|
||
export function formatBashCommand(command: string, args?: string) { |
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.
optional nit: It's not a big deal at all, just wanted to note: it sounds like too much credit to Bash
shell here ;) Maybe something like formatCommadLineSnippet\formatCli...
would be more OS/shell agnostic.
|
||
export function formatBashCommand(command: string, args?: string) { | ||
const isWindows = window.navigator.userAgent.includes('Win'); | ||
return `${isWindows ? `bin\\${command}.bat` : `bin/${command}`}${args ? ` ${args}` : ''}`; |
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.
note: it's great that we have this code in one place now 🎉 If users ever complain about false positives here we'll need to update just one place (e.g. fetch actual OS from the server).
💛 Build succeeded, but was flaky
Test Failures
Metrics [docs]Module Count
Page load bundle
History
To update your PR or re-run it, just comment with: |
* Provide more guidance on enrollment token * Added suggestions from copy review * Simplify copy * format bash commands correctly * Added suggestions from code review
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
* Provide more guidance on enrollment token * Added suggestions from copy review * Simplify copy * format bash commands correctly * Added suggestions from code review Co-authored-by: Thom Heymann <[email protected]>
* Provide more guidance on enrollment token * Added suggestions from copy review * Simplify copy * format bash commands correctly * Added suggestions from code review
* Provide more guidance on enrollment token * Added suggestions from copy review * Simplify copy * format bash commands correctly * Added suggestions from code review
This PR fixes CLI command formatting on windows
.