Diagnostic tool: correctly parse Prosody nightly build versions.

This commit is contained in:
John Livingston 2021-06-22 13:28:15 +02:00
parent 6608480826
commit 67f330017d
2 changed files with 3 additions and 2 deletions

View File

@ -7,6 +7,7 @@
* Builtin Prosody: optional settings to change the url for Prosody's API calls.
* Diagnostic tool: testing API communication from Peertube to Prosody.
* Diagnostic tool: testing API communication from Prosody to Peertube.
* Diagnostic tool: correctly parse Prosody nightly build versions.
## v3.0.0

View File

@ -74,7 +74,7 @@ export async function diagProsody (test: string, options: RegisterServerOptions)
return result
}
const versionMatches = about.match(/^Prosody\s*(\d+)\.(\d+)\.(\d+)\s*$/mi)
const versionMatches = about.match(/^Prosody\s*(\d+)\.(\d+)(?:\.(\d+)| (nightly build \d+.*))\s*$/mi)
if (!versionMatches) {
result.messages.push({
level: 'error',
@ -84,7 +84,7 @@ export async function diagProsody (test: string, options: RegisterServerOptions)
} else {
const major = versionMatches[1]
const minor = versionMatches[2]
const patch = versionMatches[3]
const patch = versionMatches[3] ?? versionMatches[4]
result.messages.push(`Prosody version is ${major}.${minor}.${patch}`)
if (major !== '0' && minor !== '11') {
result.messages.push({