From 782aae4ddffc20332f5dd6164ae9971a674b4292 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Fri, 3 May 2019 15:02:32 +0000 Subject: [PATCH] Doc: Better handling of platform in changelog autogenerate --- Tools/git-changelog.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Tools/git-changelog.js b/Tools/git-changelog.js index 5c7cbf91e..2ad64174f 100644 --- a/Tools/git-changelog.js +++ b/Tools/git-changelog.js @@ -106,9 +106,17 @@ function formatCommitMessage(msg) { const splitted = msg.split(':'); + const isPlatformPrefix = prefix => { + prefix = prefix.split(',').map(p => p.trim().toLowerCase()); + for (const p of prefix) { + if (['android', 'mobile', 'ios', 'desktop', 'cli', 'clipper', 'all'].indexOf(p) >= 0) return true; + } + return false; + } + if (splitted.length) { const platform = splitted[0].trim().toLowerCase(); - if (['android', 'mobile', 'ios', 'desktop', 'cli', 'clipper', 'all'].indexOf(platform) >= 0) { + if (isPlatformPrefix(platform)) { splitted.splice(0, 1); }