From 93c47e2fbc04da430450d1f5472750e13f0d4333 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Fri, 14 Sep 2018 05:20:27 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20patch=20verification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ssn/verify/verifyPatch.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ssn/verify/verifyPatch.ts b/src/ssn/verify/verifyPatch.ts index fc0c480..e8d82a2 100644 --- a/src/ssn/verify/verifyPatch.ts +++ b/src/ssn/verify/verifyPatch.ts @@ -15,7 +15,7 @@ export default function verifyPatch(fileEntries: ISsnFileEntry[], product: Produ const validLastFileAlternate = `Assets/${product}_version.txt`; if (lastFile.name === validLastFileName) { if (lastFile.diffType !== SsnDiffType.NewFile) { - throw new Error(`Last file (.version file) must have diffType 0 but it had diffType ${lastFile.diffType}.`); + throw new Error(`Last file (.version file) must have diffType 0but it had diffType ${lastFile.diffType}.`); } } else if (lastFile.name === validLastFileAlternate) { //In some early patches, the last file is *_version.txt and the second to last is *.version @@ -29,8 +29,8 @@ export default function verifyPatch(fileEntries: ISsnFileEntry[], product: Produ if (secondToLastFile.name !== validLastFileName) { throw new Error(`Last or second to last file must be called "${validLastFileName}" but it was "${secondToLastFile.name}".`); } - if (secondToLastFile.diffType !== SsnDiffType.NewFile) { - throw new Error(`Second to last file (.version file) must have diffType 0 but it had diffType ${secondToLastFile.diffType}.`); + if (secondToLastFile.diffType !== SsnDiffType.Changed) { + throw new Error(`Second to last file (.version file) must have diffType 2 but it had diffType ${secondToLastFile.diffType}.`); } } else { throw new Error(`Last file must be called "${validLastFileName}" or "${validLastFileAlternate}" but it was "${lastFile.name}".`);