Skip to content

Commit 29d4b59

Browse files
Ashish AggarwalAshish Aggarwal
authored andcommitted
improving version script
1 parent aa51997 commit 29d4b59

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

scripts/version.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@ const pkginfo = require('npm-registry-package-info');
22
const semver = require('semver');
33
const fs = require('fs');
44

5-
var opts = {
5+
6+
const moduleName = 'haystack-client';
7+
8+
const opts = {
69
'packages': [
7-
'haystack-client'
10+
moduleName
811
]
912
};
1013

1114
pkginfo(opts, (error, data) => {
1215
if (error) {
1316
throw error;
1417
}
15-
const currentVersion = data.data['haystack-client']['dist-tags']['latest'];
18+
const currentVersion = data.data[moduleName]['dist-tags']['latest'];
1619
const releaseVersion = process.env.TRAVIS_TAG
1720
if (!releaseVersion) {
1821
throw new Error('No git tag commit is found, fail to release the "haystack-client" module');

0 commit comments

Comments
 (0)