From c0eb113036ee95f7d520ab2c8aced8a2ebf6b446 Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Fri, 24 Jul 2020 08:33:58 +0200 Subject: [PATCH] fix double quote escape in path selector --- lib/TypeValidation/PathType.ts | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/TypeValidation/PathType.ts b/lib/TypeValidation/PathType.ts index 8866ef2..a5196d5 100644 --- a/lib/TypeValidation/PathType.ts +++ b/lib/TypeValidation/PathType.ts @@ -21,7 +21,8 @@ export class PathType extends TypeValidation { if (typeof value !== 'string') throw new Error (`invalid type for ${this.option_type}`); - const escaped = value.replace (/\\$/u, ''); + const escaped = value.replace (/\\$/u, '') + .replace (/"$/u, ''); if (!await fs.pathExists (escaped)) throw new Error ('path does not exist'); if (this.option_type === 'path') diff --git a/package.json b/package.json index e1dea98..0e762b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sapphirecode/console-app", - "version": "2.1.3", + "version": "2.1.4", "main": "dist/lib/index.js", "author": { "name": "Timo Hocker",