Skip to content

Commit

Permalink
Merge pull request #1064 from frontegg/adding-logs
Browse files Browse the repository at this point in the history
FR-14304 - Adding logs to understand the timeout
  • Loading branch information
rotemzif1 authored Nov 26, 2023
2 parents cbdfc0b + 10621e4 commit a7888db
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/wait-for-npm-indexing.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const delay = () => new Promise(resolve => setTimeout(() => resolve(), 1000));
module.exports = async (github, packages, version) => {
let timeout = 60;


const checkPackages = async () => {
if (timeout === 0) {
throw Error('TIMEOUT: Some packages does not appear in NPM registry');
Expand All @@ -14,8 +15,10 @@ module.exports = async (github, packages, version) => {
let allPackagesIndexed = true;

for (let i in packages) {
console.log(`Waiting for publish of version ${version} of ${packages[i]}`)
try {
const result = JSON.parse(execSync(`npm show ${packages[i]} --json dist-tags`).toString('utf8').trim());
console.log("Found versions: ", result)
allPackagesIndexed = allPackagesIndexed && (result.alpha === version || result.latest === version);
} catch (e) {
console.error('Failed to check version for', packages[i], e);
Expand Down

0 comments on commit a7888db

Please sign in to comment.