Skip to content

Commit 397a248

Browse files
committed
Show new release notice for all platforms.
1 parent e4ea5b7 commit 397a248

File tree

3 files changed

+22
-21
lines changed

3 files changed

+22
-21
lines changed

src/js/controllers/tab-home.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ angular.module('canoeApp.controllers').controller('tabHomeController',
3333
})
3434
}
3535

36-
if ($scope.isNW) {
36+
// TODO: For the moment we show new release notice for all platforms
37+
if (true) { // ($scope.isNW) {
3738
latestReleaseService.checkLatestRelease(function (err, newRelease) {
3839
if (err) {
3940
$log.warn(err)

src/js/services/latestReleaseService.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ angular.module('canoeApp.services')
1717
var current = formatTagNumber(currentVersion)
1818
var latest = formatTagNumber(latestVersion)
1919

20-
if (latest.major < current.major || (latest.major == current.major && latest.minor <= current.minor)) { return cb(null, false) }
20+
if (latest.major < current.major || (latest.major === current.major && latest.minor <= current.minor)) {
21+
// We are already newer or at least up to date - ignoring PATCH level.
22+
return cb(null, false)
23+
}
2124

2225
$log.debug('A new version is available: ' + latestVersion)
2326
return cb(null, true)

util/buildAppConfig.js

+16-19
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
11
#!/usr/bin/env node
22

3-
'use strict';
3+
'use strict'
44

5-
var fs = require('fs');
6-
var shell = require('shelljs');
5+
var fs = require('fs')
6+
var shell = require('shelljs')
77

8-
var getCommitHash = function() {
9-
//exec git command to get the hash of the current commit
10-
//git rev-parse HEAD
8+
var getCommitHash = function () {
9+
// exec git command to get the hash of the current commit
10+
// git rev-parse HEAD
1111

1212
var hash = shell.exec('git rev-parse HEAD', {
1313
silent: true
14-
}).output.trim().substr(0, 7);
15-
return hash;
14+
}).output.trim().substr(0, 7)
15+
return hash
1616
}
1717

18-
var commitHash = getCommitHash();
18+
var commitHash = getCommitHash()
1919

20+
var appConfig = JSON.parse(fs.readFileSync('./appConfig.json', 'utf8'))
21+
var pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'))
2022

21-
var appConfig = JSON.parse(fs.readFileSync('./appConfig.json', 'utf8'));
22-
var pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
23+
console.log('v' + pkg.version + ' #' + commitHash + ' App:' + appConfig.name)
2324

24-
console.log('v' + pkg.version + ' #' + commitHash + ' App:' + appConfig.name);
25-
26-
27-
var content = 'window.version="' + pkg.version + '";';
28-
content = content + '\nwindow.commitHash="' + commitHash + '";';
29-
30-
content = content + '\nwindow.appConfig=' + JSON.stringify(appConfig) + ';';
31-
fs.writeFileSync("./src/js/appConfig.js", content);
25+
var content = 'window.version="' + pkg.version + '";'
26+
content = content + '\nwindow.commitHash="' + commitHash + '";'
3227

28+
content = content + '\nwindow.appConfig=' + JSON.stringify(appConfig) + ';'
29+
fs.writeFileSync('./src/js/appConfig.js', content)

0 commit comments

Comments
 (0)