Skip to content

Conversation

@joshmgross
Copy link
Contributor

Supports #5113

When creating gists on Windows, the filename is not correctly parsed when the file path contains \ path separators, resulting in gists being created with the full file path as the name.

This is due to using path, which doesn't handle OS-specific file separators. Switching to filepath resolves the issue - https://pkg.go.dev/path/filepath

I've validated that the existing code fails the tests fail on a Windows machine when the file paths are created using OS-specific file separators (filePath.Join).

This is the recommended solution to #5113 (comment), but does not resolve the original request to allow defining a file name when creating gists.

@joshmgross joshmgross requested a review from a team as a code owner February 6, 2022 23:46
@joshmgross joshmgross requested review from mislav and removed request for a team February 6, 2022 23:46
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label Feb 6, 2022
Copy link
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you

@mislav mislav merged commit b59cd63 into cli:trunk Feb 7, 2022
@joshmgross joshmgross deleted the joshmgross/gist-path-handling branch February 7, 2022 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants