1
0

auto-git:

[change] main.js
This commit is contained in:
Victor Giers
2025-11-27 11:35:17 +01:00
parent c10fafb4fa
commit c6fcf26734

View File

@@ -264,18 +264,13 @@ function watchRepo(folder, win) {
/** /**
* Initiiert ein Git-Repo in `folder`, falls noch nicht vorhanden, * Initiiert ein Git-Repo in `folder`, falls noch nicht vorhanden,
* und erzeugt einen Initial-Commit mit Timestamp. * ohne Dateien oder Commits anzulegen.
*/ */
async function initGitRepo(folder) { async function initGitRepo(folder) {
const git = simpleGit(folder); const git = simpleGit(folder);
const gitDir = path.join(folder, '.git'); const gitDir = path.join(folder, '.git');
if (!fs.existsSync(gitDir)) { if (!fs.existsSync(gitDir)) {
await git.init(); 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);
} }
} }