Skip to content
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 repository field generation on Windows #2218

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/large-icons-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'modular-scripts': patch
---

Fix repository field generation on Windows
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ async function getRelativePathInRepo(packagePath: string) {
['rev-parse', '--show-toplevel'],
{ stdout: 'pipe' },
);
return path.relative(gitRepoPath, packagePath);
return path
.relative(gitRepoPath, packagePath)
.split(path.win32.sep)
Copy link
Contributor Author

@joshwooding joshwooding Dec 7, 2022

Choose a reason for hiding this comment

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

This is the same as the utils in esbuild-scripts, so probably can be cleaned up in the future to use the same utility

.join(path.posix.sep);
}

export async function getRepositoryField(packagePath: string) {
Expand Down