Ver Fonte

Merge pull request #9288 from jasongrout/publishpause

Pause after publishing packages to allow npm time to update their listing
Jason Grout há 4 anos atrás
pai
commit
e451bd4df8
1 ficheiros alterados com 13 adições e 0 exclusões
  1. 13 0
      buildutils/src/publish.ts

+ 13 - 0
buildutils/src/publish.ts

@@ -10,6 +10,10 @@ import * as path from 'path';
 import { handlePackage } from './update-dist-tag';
 import * as utils from './utils';
 
+async function sleep(wait: number): Promise<void> {
+  return new Promise(resolve => setTimeout(resolve, wait));
+}
+
 // Specify the program signature.
 commander
   .description('Publish the JS packages and prep the Python package')
@@ -53,6 +57,15 @@ commander
       });
     });
 
+    // Pause to allow npm some time to update their servers to list the published packages.
+    const pause = 10000;
+    console.log(
+      `Pausing ${
+        pause / 1000
+      } seconds after publishing to allow npmjs.com to update their package listing.`
+    );
+    await sleep(pause);
+
     // Update core mode.  This cannot be done until the JS packages are
     // released.
     utils.run('node buildutils/lib/update-core-mode.js');