Skip to content

Use / in paths in the auto-generated files' header#24883

Merged
sandersn merged 2 commits intomasterfrom
normalise-path-in-generated-file-header
Jun 12, 2018
Merged

Use / in paths in the auto-generated files' header#24883
sandersn merged 2 commits intomasterfrom
normalise-path-in-generated-file-header

Conversation

@sandersn
Copy link
Copy Markdown
Member

Fixes spurious checked-out file after building on Unix machines.

@sandersn sandersn requested a review from RyanCavanaugh June 11, 2018 23:02
let result =
"// <auto-generated />\r\n" +
"// generated from '" + inputFilePathRel + "' by '" + thisFilePathRel + "'\r\n" +
"// generated from '" + inputFilePathRel + "' by '" + thisFilePathRel.replace(/\\/g, '/') + "'\r\n" +
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should you be using path.normalize instead?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually yes please use path.normalize

let result =
"// <auto-generated />\r\n" +
"// generated from '" + inputFilePathRel + "' by '" + thisFilePathRel + "'\r\n" +
"// generated from '" + inputFilePathRel + "' by '" + thisFilePathRel.replace(/\\/g, '/') + "'\r\n" +
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually yes please use path.normalize

@sandersn
Copy link
Copy Markdown
Member Author

Nope, that's backwards. The intent of this change is to use the same character regardless of platform. We used a regex replace because the result doesn't really matter, especially now that it's gitignored.

@sandersn sandersn merged commit 51fb075 into master Jun 12, 2018
@sandersn sandersn deleted the normalise-path-in-generated-file-header branch June 12, 2018 16:04
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants