From 357861d3b610383ebb4dfe0843fba32436fc6567 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sun, 1 Jun 2025 06:46:19 +0200 Subject: [PATCH] Refactor addMatchingFilesToGitignore function to handle file patterns and update gitignore accordingly --- main.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.js b/main.js index f1570bf..33e14b0 100644 --- a/main.js +++ b/main.js @@ -666,6 +666,15 @@ function createRewriteScript(mapping) { return scriptPath; } +function addMatchingFilesToGitignore(folderPath, pattern) { + const files = fs.readdirSync(folderPath); + const matches = micromatch(files, pattern); + for (const file of matches) { + ensureInGitignore(folderPath, pattern); + break; // Nur einmal pro Pattern eintragen + } +} + async function autoCommit(folderPath, message, win) { // ---- AUTOGENERATE .gitignore ----