1
0

Remove unused code from main.js

This commit is contained in:
2025-06-01 11:46:54 +02:00
parent 12cd409616
commit dab6c42e6d

20
main.js
View File

@@ -1101,27 +1101,7 @@ function getRandomMessage() {
*/
// Nutze das Template aus dem Projektordner:
const TEMPLATE_PATH = path.join(__dirname, 'rewrite-commit-msg.js.template');
function createRewriteScript(mapping) {
// Lies das Template
let content = fs.readFileSync(TEMPLATE_PATH, 'utf-8');
// Ersetze __MESSAGE_MAP__ durch dein Mapping
content = content.replace('__MESSAGE_MAP__', JSON.stringify(mapping));
// Speichere als temporäre Datei
const scriptPath = path.join(__dirname, `rewrite-commit-msg.${Date.now()}.js`);
fs.writeFileSync(scriptPath, content, 'utf-8');
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) {