Browse Source

feat(scripts): improve publish script

pull/2366/head
mehmet-erim 7 years ago
parent
commit
170d19b2cf
  1. 1
      npm/ng-packs/scripts/package.json
  2. 13
      npm/ng-packs/scripts/publish.js

1
npm/ng-packs/scripts/package.json

@ -6,6 +6,7 @@
"modules": "[build.js, sync.js]",
"scripts": {
"build": "node -r esm build.js",
"publish": "node -r esm publish.js",
"install-new-dependencies": "node -r esm install-new-dependencies.js",
"sync": "node -r esm sync.js",
"test": "echo \"Error: no test specified\" && exit 1"

13
npm/ng-packs/scripts/publish.js

@ -1,6 +1,17 @@
// ESM syntax is supported.
import execa from 'execa';
import fse from 'fs-extra';
const versions = ['major', 'minor', 'patch', 'premajor', 'preminor', 'prepatch', 'prerelease'];
let nextSemanticVersion = (process.argv[2] || '').toLowerCase();
if (versions.indexOf(nextSemanticVersion) < 0) {
console.log(
"Please enter the next semantic version like this: 'npm run publish patch'. Available versions: " +
JSON.stringify(versions),
);
process.exit(1);
}
(async () => {
try {

Loading…
Cancel
Save