1
0

auto-git:

[change] main.js
 [change] preload.js
 [change] renderer.js
This commit is contained in:
2025-05-24 06:05:52 +02:00
parent 18ba00205d
commit abc1ba77b3
3 changed files with 103 additions and 0 deletions

38
main.js
View File

@@ -484,6 +484,44 @@ app.whenReady().then(() => {
ipcMain.handle('set-skip-git-prompt', (_e,val) => store.set('skipGitPrompt', val));
// Auto-Verzeichnisstruktur
const IGNORED_NAMES = [
'.DS_Store', 'node_modules', '.git', 'dist', 'build',
'.cache', 'out', '.venv', '.mypy_cache', '__pycache__'
];
// Hilfsfunktion: Dateinamen oder Ordner ignorieren?
function isIgnored(name) {
return IGNORED_NAMES.includes(name);
}
function walkDir(base, rel = '.') {
const full = path.join(base, rel);
let list = [];
try {
fs.readdirSync(full, { withFileTypes: true }).forEach(dirent => {
if (isIgnored(dirent.name)) return;
const entry = path.join(rel, dirent.name);
if (dirent.isDirectory()) {
list.push({ name: dirent.name, type: 'dir', children: walkDir(base, entry) });
} else {
list.push({ name: dirent.name, type: 'file' });
}
});
} catch (e) {
// Permissions o.ä. ignorieren
}
return list;
}
ipcMain.handle('get-folder-tree', async (_e, folderPath) => {
try {
return walkDir(folderPath, '.');
} catch {
return [];
}
});