@tangelo/tangelo-configuration-toolkit 1.8.0-beta.1 → 1.8.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangelo/tangelo-configuration-toolkit",
3
- "version": "1.8.0-beta.1",
3
+ "version": "1.8.0-beta.2",
4
4
  "description": "Tangelo Configuration Toolkit is a command-line toolkit which offers support for developing a Tangelo configuration.",
5
5
  "bin": {
6
6
  "tct": "bin/index.js",
@@ -20,11 +20,12 @@
20
20
  "babel-core": "^6.26.3",
21
21
  "babel-preset-es2015-without-strict": "0.0.4",
22
22
  "cli-spinner": "^0.2.10",
23
+ "compare-versions": "^4.1.1",
23
24
  "del": "^6.0.0",
24
25
  "event-stream": "^4.0.1",
25
26
  "find-up": "^5.0.0",
26
- "globby": "^6.1.0",
27
27
  "fs-extra": "^10.0.0",
28
+ "globby": "^6.1.0",
28
29
  "gulp": "^4.0.2",
29
30
  "gulp-babel": "^7.0.1",
30
31
  "gulp-eol": "^0.2.0",
package/src/cli.js CHANGED
@@ -123,7 +123,7 @@ module.exports = function cli () {
123
123
  _write(_appconfig);
124
124
  }
125
125
 
126
- if (argv.updateTct) {
126
+ if (argv.update) {
127
127
  _info('Updating TCT...');
128
128
  getLatestPackageVersion({package: 'TCT', version: _package.version})
129
129
  .then(updatePackage)
@@ -152,7 +152,7 @@ module.exports = function cli () {
152
152
 
153
153
  _write(); // print empty line before and after update check
154
154
 
155
- if (!(argv.updateTct || argv.updateFdt) && // not when doing update
155
+ if (!(argv.update || argv.updateFdt) && // not when doing update
156
156
  (!_appdata.updateCheckTCT?.versionAvailable || !_appdata.updateCheckFDT?.versionAvailable) && // not if already known that update is available
157
157
  ( new Date() - new Date(_appdata.updateCheckTCT?.executed || 0) > 1000*3600*24*3 ||
158
158
  new Date() - new Date(_appdata.updateCheckFDT?.executed || 0) > 1000*3600*24*3
@@ -1,3 +1,4 @@
1
+ const {compare} = require('compare-versions');
1
2
  const util = require('util');
2
3
  const exec = util.promisify(require('child_process').exec);
3
4
 
@@ -19,7 +20,7 @@ const getLatestPackageVersion = ({package, version}) => (
19
20
  exec(`npm view -g ${packageNames[package]} version`)
20
21
  .then(r => {
21
22
  const versionAvailable = r.stdout.match(/([\d/.]+)/)[1];
22
- if (version==versionAvailable) {
23
+ if (compare(version, versionAvailable, '>=')) {
23
24
  updateAppdata({[`updateCheck${package}`]: {executed: new Date()}});
24
25
  _write(`Using latest version of ${package}.`);
25
26
  }
@@ -33,7 +34,7 @@ const getLatestPackageVersion = ({package, version}) => (
33
34
  );
34
35
 
35
36
  const updatePackage = ({package, version, versionAvailable}) => (
36
- version!=versionAvailable &&
37
+ compare(version, versionAvailable, '<') &&
37
38
  exec(`npm install -g ${packageNames[package]}`)
38
39
  .then(r => {
39
40
  updateAppdata({[`updateCheck${package}`]: {executed: new Date()}});