Diagnostic tool: correctly parse Prosody nightly build versions.
This commit is contained in:
parent
6608480826
commit
67f330017d
@ -7,6 +7,7 @@
|
|||||||
* Builtin Prosody: optional settings to change the url for Prosody's API calls.
|
* 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 Peertube to Prosody.
|
||||||
* Diagnostic tool: testing API communication from Prosody to Peertube.
|
* Diagnostic tool: testing API communication from Prosody to Peertube.
|
||||||
|
* Diagnostic tool: correctly parse Prosody nightly build versions.
|
||||||
|
|
||||||
## v3.0.0
|
## v3.0.0
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ export async function diagProsody (test: string, options: RegisterServerOptions)
|
|||||||
return result
|
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) {
|
if (!versionMatches) {
|
||||||
result.messages.push({
|
result.messages.push({
|
||||||
level: 'error',
|
level: 'error',
|
||||||
@ -84,7 +84,7 @@ export async function diagProsody (test: string, options: RegisterServerOptions)
|
|||||||
} else {
|
} else {
|
||||||
const major = versionMatches[1]
|
const major = versionMatches[1]
|
||||||
const minor = versionMatches[2]
|
const minor = versionMatches[2]
|
||||||
const patch = versionMatches[3]
|
const patch = versionMatches[3] ?? versionMatches[4]
|
||||||
result.messages.push(`Prosody version is ${major}.${minor}.${patch}`)
|
result.messages.push(`Prosody version is ${major}.${minor}.${patch}`)
|
||||||
if (major !== '0' && minor !== '11') {
|
if (major !== '0' && minor !== '11') {
|
||||||
result.messages.push({
|
result.messages.push({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user