Skip to content

Commit 07b7eeb

Browse files
don't try to update an all-contributorrc that isn't there
1 parent 666d042 commit 07b7eeb

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

plugins/all-contributors/src/index.ts

+10-3
Original file line numberDiff line numberDiff line change
@@ -326,14 +326,21 @@ export default class AllContributorsPlugin implements IPlugin {
326326
} catch (error) {}
327327

328328
// Go through each package and update code contributions
329-
await packages.reduce(async (last, { name, path }) => {
329+
await packages.reduce(async (last, { name, path: packagePath }) => {
330330
// Cannot run git operations in parallel
331331
await last;
332332

333+
if (!fs.existsSync(path.join(packagePath, ".all-contributorsrc"))) {
334+
auto.logger.verbose.info(
335+
`Skipping ${name} because it has no all-contributorsrc file.`
336+
);
337+
return;
338+
}
339+
333340
auto.logger.verbose.info(`Updating contributors for: ${name}`);
334341

335342
const includedCommits = commits.filter((commit) =>
336-
commit.files.some((file) => inFolder(path, file))
343+
commit.files.some((file) => inFolder(packagePath, file))
337344
);
338345

339346
if (includedCommits.length > 0) {
@@ -344,7 +351,7 @@ export default class AllContributorsPlugin implements IPlugin {
344351
`With commits: ${JSON.stringify(includedCommits, null, 2)}`
345352
);
346353

347-
process.chdir(path);
354+
process.chdir(packagePath);
348355
await this.updateContributors(auto, includedCommits);
349356
}
350357
}, Promise.resolve());

0 commit comments

Comments
 (0)