리펙토링: Node.js 프로젝트 폴더 구조 적용
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
const { ipcMain, dialog, shell } = require('electron');
|
||||
|
||||
function register(mainWindow) {
|
||||
ipcMain.handle('select-folder', async () => {
|
||||
const result = await dialog.showOpenDialog(mainWindow, {
|
||||
properties: ['openDirectory'],
|
||||
title: '이미지 폴더 선택',
|
||||
});
|
||||
if (result.canceled) return null;
|
||||
return result.filePaths[0];
|
||||
});
|
||||
|
||||
ipcMain.handle('reveal-folder', async (_event, folderPath) => {
|
||||
shell.openPath(folderPath);
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = { register };
|
||||
Reference in New Issue
Block a user