From ecde07899eaa39c98c11f1628801f929fc66d131 Mon Sep 17 00:00:00 2001 From: GermanBluefox Date: Thu, 3 Oct 2024 14:17:23 +0800 Subject: [PATCH] Fixing copyFiles --- README.md | 2 +- index.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dad9b72..4077f5f 100644 --- a/README.md +++ b/README.md @@ -198,7 +198,7 @@ node node_modules/@iobroker/build-tools/convertI18n.js path/to/i18n --> ## Changelog -### 2.0.3 (2024-10-03) +### **WORK IN PROGRESS** - (@GermanBluefox) Used glob for patterns diff --git a/index.ts b/index.ts index 8295179..369dc56 100644 --- a/index.ts +++ b/index.ts @@ -113,6 +113,11 @@ export function collectFiles(patterns: string[] | string): { name: string; base: const files: string[] = globSync(_patterns[i]); for (let f = 0; f < files.length; f++) { + files[f] = files[f].replace(/\\/g, '/'); + if (files[f].startsWith(folder)) { + files[f] = files[f].substring(folder.length + 1); + } + if (add) { // ignore folders if (statSync(join(folder, files[f])).isDirectory()) {