1
0

Add check for relocation or non-existent folder before removing .git directory

This commit is contained in:
2025-05-25 05:18:24 +02:00
parent aaacaa9e2d
commit 9cc35b38c7

View File

@@ -820,6 +820,9 @@ app.whenReady().then(() => {
// Entferne das .git-Verzeichnis
ipcMain.handle('remove-git-folder', async (_e, folderObj) => {
if (folderObj.needsRelocation || !fs.existsSync(folderObj.path)) {
return false;
}
const gitDir = path.join(folderObj.path, '.git');
if (fs.existsSync(gitDir)) {
await fs.promises.rm(gitDir, { recursive: true, force: true });