Skip to content

Commit bd048c4

Browse files
Merge pull request #849 from pattern-lab/cli-getVersion
Static getVersion
2 parents d8b58d3 + f9dcd4d commit bd048c4

File tree

4 files changed

+13
-95
lines changed

4 files changed

+13
-95
lines changed

packages/cli/.editorconfig

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/cli/.eslintrc

Lines changed: 0 additions & 78 deletions
This file was deleted.
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
'use strict';
22
const patternlab = require('@pattern-lab/core');
3-
const config = Object.assign(patternlab.getDefaultConfig(), {
4-
logLevel: 'quiet',
5-
});
63

7-
module.exports = ({ version }) =>
8-
`${version} (PatternLab Node Core version: ${patternlab(config).version()})`;
4+
module.exports = ({ version }) => {
5+
`${version} (PatternLab Node Core version: ${patternlab.getVersion()})`;
6+
};

packages/core/src/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ const getDefaultConfig = function() {
4242
return defaultConfig;
4343
};
4444

45+
/**
46+
* Returns current version
47+
*
48+
* @returns {string} current patternlab-node version as defined in `package.json`, as string
49+
*/
50+
const getVersion = function() {
51+
return packageInfo.version;
52+
};
53+
4554
const patternlab_module = function(config) {
4655
const PatternLabClass = require('./lib/patternlab');
4756
const patternlab = new PatternLabClass(config);
@@ -222,5 +231,6 @@ const patternlab_module = function(config) {
222231
};
223232

224233
patternlab_module.getDefaultConfig = getDefaultConfig;
234+
patternlab_module.getVersion = getVersion;
225235

226236
module.exports = patternlab_module;

0 commit comments

Comments
 (0)