linny-r 1.1.16 → 1.1.17

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server.js +7 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linny-r",
3
- "version": "1.1.16",
3
+ "version": "1.1.17",
4
4
  "description": "Executable graphical language with WYSIWYG editor for MILP models",
5
5
  "main": "server.js",
6
6
  "scripts": {
package/server.js CHANGED
@@ -75,10 +75,12 @@ function getVersionInfo() {
75
75
  console.log('This indicates that Linny-R is not installed properly.');
76
76
  process.exit();
77
77
  }
78
+ console.log('\nNode.js server for Linny-R version', info.current);
79
+ console.log('Looking for newer version on https://npmjs.com');
78
80
  try {
79
81
  const
80
- json = child_process.execSync(
81
- 'npm show linny-r time version --json', {timeout: 1000}),
82
+ json = child_process.execSync(
83
+ 'npm show linny-r time version --json', {timeout: 5000}),
82
84
  obj = JSON.parse(json);
83
85
  info.latest = obj.version;
84
86
  info.latest_time = new Date(Date.parse(obj.time[info.latest]));
@@ -88,12 +90,13 @@ function getVersionInfo() {
88
90
  // `latest` = 0 indicates that version check failed
89
91
  info.latest = 0;
90
92
  }
91
- console.log('\nNode.js server for Linny-R version', info.current);
92
93
  if(!info.latest) {
93
- console.log('WARNING: Could not check for updates');
94
+ console.log(connectionErrorText('Could not connect to https://nodejs.com'));
94
95
  } else if(!info.up_to_date) {
95
96
  console.log('UPDATE: Version ' + info.latest + ' was released on ' +
96
97
  info.latest_time.toString());
98
+ } else {
99
+ console.log('Linny-R software is up-to-date');
97
100
  }
98
101
  return info;
99
102
  }