1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 17:59:37 +02:00

Add runner version info

This commit is contained in:
Chocobozzz 2025-07-29 10:30:23 +02:00
parent 309068ae1d
commit 3e1cdb9fa2
No known key found for this signature in database
GPG key ID: 583A612D890159BE
23 changed files with 233 additions and 192 deletions

View file

@ -171,3 +171,26 @@ export function toIntArray (value: any) {
return value.map(v => validator.default.toInt(v))
}
// ---------------------------------------------------------------------------
export function isStableVersionValid (value: string) {
if (!exists(value)) return false
const parts = (value + '').split('.')
return parts.length === 3 && parts.every(p => validator.default.isInt(p))
}
export function isStableOrUnstableVersionValid (value: string) {
if (!exists(value)) return false
// suffix is beta.x or alpha.x
const [ stable, suffix ] = value.split('-')
if (!isStableVersionValid(stable)) return false
const suffixRegex = /^(rc|alpha|beta)\.\d+$/
if (suffix && !suffixRegex.test(suffix)) return false
return true
}