From 6c456e2da2c32d4dbb38bf44f1f7a3029fb29ab4 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sun, 1 Jun 2025 05:55:34 +0200 Subject: [PATCH] Enable README creation and proper initial commit in auto-git --- main.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.js b/main.js index 81eecc5..8c9d306 100644 --- a/main.js +++ b/main.js @@ -220,16 +220,16 @@ function watchRepo(folder, win) { * Initiiert ein Git-Repo in `folder`, falls noch nicht vorhanden, * und erzeugt einen Initial-Commit mit Timestamp. */ -async function initGitRepo(folder) { +async function initGitRepo(folder) { const git = simpleGit(folder); const gitDir = path.join(folder, '.git'); if (!fs.existsSync(gitDir)) { await git.init(); const message = `Initial commit (generated by auto-git)`; - //const readmePath = path.join(folder, 'README.md'); - //fs.writeFileSync(readmePath, `# Projekt in ${path.basename(folder)}\n`); - //await git.add('./*'); - //await git.commit(message); + const readmePath = path.join(folder, 'README.md'); + fs.writeFileSync(readmePath, `# Projekt in ${path.basename(folder)}\n`); //this is shit, it just writes something to prevent bugs when dealing with an empty folder, can be solved way better + await git.add('./*'); + await git.commit(message); } }