From a073033bfbee275c6fcf6a8877be4bd39f057fa6 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Sun, 4 Nov 2018 17:08:35 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Be=20more=20explicit=20in?= =?UTF-8?q?=20RegExp=20parsing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/getPatchZip.ts | 4 ++-- src/getSolidpkg.ts | 4 ++-- src/installPatch.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/getPatchZip.ts b/src/getPatchZip.ts index a5c3b2e..9d19204 100644 --- a/src/getPatchZip.ts +++ b/src/getPatchZip.ts @@ -5,8 +5,8 @@ import { getPatchZip, ISsnFileEntry, Product, verifyProductName } from 'ssn'; const { args, fail } = parseArguments({ product: { short: 'p', description: 'Name of the product you want to get the patch info on', verify: verifyProductName, message: (value) => `"${value}" is not a valid product name.` }, - from: { short: 'f', description: 'Number of the from release, must be an integer in the range [-1, 999]', verify: (str) => (str.match(/^(-1|0|[1-9][0-9]{0,2})$/) !== null) }, - to: { short: 't', description: 'Number of the to release, must be an integer in the range [0, 999]', verify: (str) => (str.match(/^(0|[1-9][0-9]{0,2})$/) !== null) }, + from: { short: 'f', description: 'Number of the from release, must be an integer in the range [-1, 999]', verify: (str) => (str.match(/^(?:-1|0|[1-9][0-9]{0,2})$/) !== null) }, + to: { short: 't', description: 'Number of the to release, must be an integer in the range [0, 999]', verify: (str) => (str.match(/^(?:0|[1-9][0-9]{0,2})$/) !== null) }, }, (origArgs) => ((origArgs.length === 3) ? ['--product', origArgs[0], '--from', origArgs[1], '--to', origArgs[2]] : undefined)); //Get the .zip file from this patch and write output to stdout diff --git a/src/getSolidpkg.ts b/src/getSolidpkg.ts index 7faed25..08ef1a4 100644 --- a/src/getSolidpkg.ts +++ b/src/getSolidpkg.ts @@ -5,8 +5,8 @@ import { getSolidpkg, ISolidSimple, Product, verifyProductName } from 'ssn'; const { args, fail } = parseArguments({ product: { short: 'p', description: 'Name of the product you want to get the solidpkg on', verify: verifyProductName, message: (value) => `"${value}" is not a valid product name.` }, - from: { short: 'f', description: 'Number of the from release, must be an integer in the range [-1, 999]', verify: (str) => (str.match(/^(-1|0|[1-9][0-9]{0,2})$/) !== null) }, - to: { short: 't', description: 'Number of the to release, must be an integer in the range [0, 999]', verify: (str) => (str.match(/^(0|[1-9][0-9]{0,2})$/) !== null) }, + from: { short: 'f', description: 'Number of the from release, must be an integer in the range [-1, 999]', verify: (str) => (str.match(/^(?:-1|0|[1-9][0-9]{0,2})$/) !== null) }, + to: { short: 't', description: 'Number of the to release, must be an integer in the range [0, 999]', verify: (str) => (str.match(/^(?:0|[1-9][0-9]{0,2})$/) !== null) }, }, (origArgs) => ((origArgs.length === 3) ? ['--product', origArgs[0], '--from', origArgs[1], '--to', origArgs[2]] : undefined)); //Get solidpkg and write output to stdout diff --git a/src/installPatch.ts b/src/installPatch.ts index 5a2072f..3a1e1c3 100644 --- a/src/installPatch.ts +++ b/src/installPatch.ts @@ -5,8 +5,8 @@ import { installPatch, Product, verifyProductName } from 'ssn'; const { args, fail } = parseArguments({ product: { short: 'p', description: 'Name of the product you want to install', verify: verifyProductName, message: (value) => `"${value}" is not a valid product name.` }, - from: { short: 'f', description: 'Number of the from release, must be an integer in the range [-1, 999]', verify: (str) => (str.match(/^(-1|0|[1-9][0-9]{0,2})$/) !== null) }, - to: { short: 't', description: 'Number of the to release, must be an integer in the range [0, 999]', verify: (str) => (str.match(/^(0|[1-9][0-9]{0,2})$/) !== null) }, + from: { short: 'f', description: 'Number of the from release, must be an integer in the range [-1, 999]', verify: (str) => (str.match(/^(?:-1|0|[1-9][0-9]{0,2})$/) !== null) }, + to: { short: 't', description: 'Number of the to release, must be an integer in the range [0, 999]', verify: (str) => (str.match(/^(?:0|[1-9][0-9]{0,2})$/) !== null) }, }, (origArgs) => ((origArgs.length === 3) ? ['--product', origArgs[0], '--from', origArgs[1], '--to', origArgs[2]] : undefined)); //TODO: set directory with existing patch data