Fix version regex

This commit is contained in:
Vrganj 2021-01-14 21:21:10 +01:00
parent c15f9a9942
commit 3f301b8c1f
1 changed files with 7 additions and 1 deletions

View File

@ -30,7 +30,13 @@ const { spawn } = require('child_process');
if (section.length >= 2) { if (section.length >= 2) {
const language = section[0]; const language = section[0];
versions[language] = /\d.\d.\d/.exec(section.slice(1).join('\n'))?.[0]; if (language === 'java') {
versions[language] = /\d+/.exec(section[2]);
} else if (language === 'emacs') {
versions[language] = /\d+\.\d+/.exec(section[2]);
} else {
versions[language] = /\d\.\d\.\d/.exec(section.slice(1).join('\n'))?.[0];
}
} }
} }