Explorar o código

NPM - adding "preview" tag to alpha and beta releases
Addressing - https://github.com/BabylonJS/Babylon.js/issues/3055
alpha and beta releases will not show as latest from the moment this script is used to publish.
The latest preview release will be installed using `npm install babylonjs@preview`

Raanan Weber %!s(int64=7) %!d(string=hai) anos
pai
achega
bc13392760
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      Tools/Publisher/index.js

+ 8 - 1
Tools/Publisher/index.js

@@ -185,8 +185,15 @@ function processCore(package, version) {
     fs.writeFileSync(basePath + '/package/' + 'package.json', JSON.stringify(packageJson, null, 4));
 
     console.log('Publishing ' + package.name + " from " + basePath + '/package/');
+
+    let tagDef = "";
+    // check for alpha or beta
+    if (version.indexOf('alpha') !== -1 || version.indexOf('beta') !== -1) {
+        tagDef = '--tag preview';
+    }
+
     //publish the respected package
-    shelljs.exec('npm publish \"' + basePath + '/package/' + "\"");
+    shelljs.exec('npm publish \"' + basePath + '/package/' + "\"" + ' ' + tagDef);
 
     // remove package directory
     fs.removeSync(basePath + '/package/');