Skip to content

Commit

Permalink
fix: Do not print "not coherent" logs on first external linking
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Sep 8, 2024
1 parent 122c3b1 commit 47c7871
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/setup-dependency/install-external/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,19 @@ module.exports = async (dependencyContext, userConfiguration, progressData) => {
}
if (isToBeLinked) {
const linkedPath = relative(dirname(path), sourceDirname);
if (!(await isSymlink(path, { linkPath: linkedPath }))) {
if (await isSymlink(path, { linkPath: linkedPath })) {
if (await isCoherent(dependencyContext, getPackageJson(path))) return;
log.notice("%s not coherent %s, relinking binaries", dependentContext.name, name);
} else {
const isInstalled = await lstat(path, { loose: true });
if (isInstalled) await rm(path, { loose: true, recursive: true, force: true });
log.notice("%s linking %s @ %s", dependentContext.name, name, targetVersion);
await symlink(linkedPath, path, { intermediate: true });
dependentContext.installationJobs.add(
`${ isInstalled ? "update" : "install" }-dependency:${ name }`
);
if (await isCoherent(dependencyContext, getPackageJson(path))) return;
}
if (await isCoherent(dependencyContext, getPackageJson(path))) return;
log.notice("%s not coherent %s, relinking binaries", dependentContext.name, name);
} else {
const isInstalled = await isDirectory(path);
const dependencyPackageJson = isInstalled ? getPackageJson(path) : null;
Expand Down

0 comments on commit 47c7871

Please sign in to comment.