Skip to content

Commit

Permalink
do not use path.join
Browse files Browse the repository at this point in the history
Git uses forward slashes, even on windows
  • Loading branch information
tevanoff committed May 14, 2024
1 parent e368c0f commit ab6d80f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions node-src/lib/findChangedDependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ export const findChangedDependencies = async (ctx: Context) => {
ctx.log.debug({ rootPath, rootManifestPath, rootLockfilePath }, `Found manifest and lockfile`);

// Handle monorepos with (multiple) nested package.json files.
const nestedManifestPaths = await findFilesFromRepositoryRoot(path.join('**', PACKAGE_JSON));
// Note that this does not use `path.join` to concatenate the file paths because
// git uses forward slashes, even on windows
const nestedManifestPaths = await findFilesFromRepositoryRoot(`**/${PACKAGE_JSON}`);
const metadataPathPairs = await Promise.all(
nestedManifestPaths.map(async (manifestPath) => {
const dirname = path.dirname(manifestPath);
const [lockfilePath] = await findFilesFromRepositoryRoot(
path.join(dirname, YARN_LOCK),
path.join(dirname, PACKAGE_LOCK)
`${dirname}/${YARN_LOCK}`,
`${dirname}/${PACKAGE_LOCK}`
);
// Fall back to the root lockfile if we can't find one in the same directory.
return [manifestPath, lockfilePath || rootLockfilePath];
Expand Down

0 comments on commit ab6d80f

Please sign in to comment.