1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Doc: Better handling of platforms in changelog generation

This commit is contained in:
Laurent Cozic 2019-05-03 00:19:42 +01:00
parent 7670ce32b1
commit aa60923cbd
2 changed files with 11 additions and 9 deletions

View File

@ -4112,7 +4112,7 @@
},
"nan": {
"version": "2.10.0",
"resolved": "http://registry.npmjs.org/nan/-/nan-2.10.0.tgz",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz",
"integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA=="
},
"needle": {

View File

@ -81,17 +81,19 @@ function filterLogs(logs, platform) {
if (revertedLogs.indexOf(log.message) >= 0) continue;
const msg = log.message.trim().toLowerCase();
let prefix = log.message.trim().toLowerCase().split(':');
if (prefix.length <= 1) continue;
prefix = prefix[0].split(',').map(s => s.trim());
let addIt = false;
if (msg.indexOf('all:') === 0 && platform !== 'clipper') addIt = true;
if ((platform === 'android' || platform === 'ios') && msg.indexOf('mobile:') === 0) addIt = true;
if (platform === 'android' && msg.indexOf('android:') === 0) addIt = true;
if (platform === 'ios' && msg.indexOf('ios:') === 0) addIt = true;
if (platform === 'desktop' && msg.indexOf('desktop:') === 0) addIt = true;
if (platform === 'cli' && msg.indexOf('cli:') === 0) addIt = true;
if (platform === 'clipper' && msg.indexOf('clipper:') === 0) addIt = true;
if (prefix.indexOf('all') >= 0 && platform !== 'clipper') addIt = true;
if ((platform === 'android' || platform === 'ios') && prefix.indexOf('mobile') >= 0) addIt = true;
if (platform === 'android' && prefix.indexOf('android') >= 0) addIt = true;
if (platform === 'ios' && prefix.indexOf('ios') >= 0) addIt = true;
if (platform === 'desktop' && prefix.indexOf('desktop') >= 0) addIt = true;
if (platform === 'cli' && prefix.indexOf('cli') >= 0) addIt = true;
if (platform === 'clipper' && prefix.indexOf('clipper') >= 0) addIt = true;
if (addIt) output.push(log);
}