Skip to content

Commit

Permalink
Upstream made more future-proof (#4083)
Browse files Browse the repository at this point in the history
* Add some logs to verfiy

* Verify equals solution

* Test for of solution

* Code cleanup
  • Loading branch information
MichalKinas authored Sep 3, 2024
1 parent f1ea904 commit 8308875
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/gh/update/latest-version-of.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,16 @@ module.exports = async ({ exec, github, dependencyName, tag }) => {
}
};
await exec.exec(`npm dist-tag ls @alfresco/${dependencyName}`, [], options);
let matchedPkgVersion = '';
const tagsType = packageDistTag.split('\n');
const matchedPkgVersion = tagsType.find((tagType) => tagType.includes(tag))?.split(':')[1].trim();
for (const tagType of tagsType) {
const tagSplit = tagType.split(':');
if (tagSplit[0].trim() === tag) {
matchedPkgVersion = tagSplit[1].trim();
break;
}
}

const latestPkgToUpdate = availablePackages.find((package) => package.name === matchedPkgVersion);

if (localVersion === latestPkgToUpdate?.name) {
Expand Down

0 comments on commit 8308875

Please sign in to comment.