From 97d844c3d26d1569998b5d3b7323cfe75a058b0f Mon Sep 17 00:00:00 2001 From: Kim Biesbjerg Date: Sat, 21 Mar 2020 04:18:07 -0700 Subject: [PATCH] Fix paths on Windows. Closes #171 --- src/translations/de-DE.json | 1 + src/translations/en-DE.json | 1 + src/translations/en-US.json | 1 + src/utils/fs-helpers.ts | 8 +++++++- 4 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 src/translations/de-DE.json create mode 100644 src/translations/en-DE.json create mode 100644 src/translations/en-US.json diff --git a/src/translations/de-DE.json b/src/translations/de-DE.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/src/translations/de-DE.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/translations/en-DE.json b/src/translations/en-DE.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/src/translations/en-DE.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/translations/en-US.json b/src/translations/en-US.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/src/translations/en-US.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/utils/fs-helpers.ts b/src/utils/fs-helpers.ts index 8c392b4..601815b 100644 --- a/src/utils/fs-helpers.ts +++ b/src/utils/fs-helpers.ts @@ -2,6 +2,12 @@ import * as os from 'os'; import * as fs from 'fs'; import * as braces from 'braces'; +declare module 'braces' { + interface Options { + keepEscaping?: boolean; // Workaround for option not present in @types/braces 3.0.0 + } +} + export function normalizeHomeDir(path: string): string { if (path.substring(0, 1) === '~') { return `${os.homedir()}/${path.substring(1)}`; @@ -10,7 +16,7 @@ export function normalizeHomeDir(path: string): string { } export function expandPattern(pattern: string): string[] { - return braces(pattern, { expand: true }); + return braces(pattern, { expand: true, keepEscaping: true }); } export function normalizePaths(patterns: string[], defaultPatterns: string[] = []): string[] {