✔ Fix checking of announce url
This commit is contained in:
parent
a7e9a288f2
commit
b5037c2a71
1 changed files with 4 additions and 5 deletions
|
@ -5,13 +5,12 @@ export default function verifySolidpkg(file: ISolid, { product, from, to }: {pro
|
||||||
if (typeof file['creation date'] !== 'number') {
|
if (typeof file['creation date'] !== 'number') {
|
||||||
throw new Error(`Expected creation date to be a number but it was "${file['creation date']}".`);
|
throw new Error(`Expected creation date to be a number but it was "${file['creation date']}".`);
|
||||||
}
|
}
|
||||||
|
//used by most .solidpkg files
|
||||||
const announceGeneral = /^http:\/\/Tracker22\.[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}\.automated\.(tel\.swtor\.com|ssntracker\.int):80\/$/;
|
const announceGeneral = /^http:\/\/Tracker22\.[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}\.automated\.(tel\.swtor\.com|ssntracker\.int):80\/$/;
|
||||||
|
//used by retailclient_swtor_-1to0
|
||||||
const announceRetailclientSwtor = /^http:\/\/Tracker14\.[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}\.automated\.snxd\.com:2500\/$/;
|
const announceRetailclientSwtor = /^http:\/\/Tracker14\.[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}\.automated\.snxd\.com:2500\/$/;
|
||||||
if (file.announce.match(announceGeneral) === null && product !== 'retailclient_swtor') {
|
if (file.announce.match(announceGeneral) === null && file.announce.match(announceRetailclientSwtor) === null) {
|
||||||
throw new Error(`Expected general announce URL but it was "${file.announce}".`);
|
throw new Error(`Expected announce URL but it was "${file.announce}".`);
|
||||||
}
|
|
||||||
if (file.announce.match(announceRetailclientSwtor) === null && product === 'retailclient_swtor') {
|
|
||||||
throw new Error(`Expected retailclient announce URL but it was "${file.announce}".`);
|
|
||||||
}
|
}
|
||||||
if (file.title !== `${product}: ${from}to${to}`) {
|
if (file.title !== `${product}: ${from}to${to}`) {
|
||||||
throw new Error(`Expected title "${product}: ${from}to${to}" but it was "${file.title}".`);
|
throw new Error(`Expected title "${product}: ${from}to${to}" but it was "${file.title}".`);
|
||||||
|
|
Loading…
Reference in a new issue