Skip to content

Commit b6fc3fa

Browse files
committed
Add Go to Folder
1 parent 67f29fb commit b6fc3fa

3 files changed

Lines changed: 36 additions & 0 deletions

File tree

frontend/app.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,8 @@ function setup() {
558558

559559
$("#IDEButton").on("click", () => launchInIDE());
560560

561+
$("#FolderButton").on("click", () => launchInIDE());
562+
561563

562564
$("#verboseOption").checkbox();
563565
$("#verboseOption").on("change", () => {
@@ -1179,3 +1181,16 @@ function launchInIDE(){
11791181

11801182
ipcRenderer.send('launchProjectinIDE', project );
11811183
}
1184+
1185+
function launchFolder(){
1186+
const platform = getPlatformList()[0];
1187+
1188+
const project = {
1189+
'projectName': $("#projectName").val(),
1190+
'projectPath': $("#projectPath").val(),
1191+
'platform': platform,
1192+
'ofPath': $("#ofPath").val()
1193+
};
1194+
1195+
ipcRenderer.send('launchFolder', project );
1196+
}

frontend/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@
349349
</div>
350350
<div class="actions">
351351
<div class="ui cancel button" id="IDEButton" style="display: none;">Open in IDE</div>
352+
<div class="ui cancel button" id="FolderButton" style="display: none;">Open Folder</div>
352353
<div class="ui cancel button">Close</div>
353354
</div>
354355
</div>

frontend/index.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,6 +1150,26 @@ ipcMain.on('launchProjectinIDE', (event, arg) => {
11501150
}
11511151
});
11521152

1153+
ipcMain.on('launchFolder', (event, arg) => {
1154+
const {
1155+
projectPath,
1156+
projectName } = arg;
1157+
const fullPath = path.join(projectPath, projectName);
1158+
1159+
try {
1160+
if(fs.existsSync(fullPath) && fs.statSync(fullPath).isDirectory()) {
1161+
await shell.openPath(fullPath);
1162+
event.sender.send('launchFolderCompleted', true);
1163+
} else {
1164+
// project doesn't exist
1165+
event.sender.send('launchFolderCompleted', false);
1166+
}
1167+
} catch (error) {
1168+
console.error('Error opening folder:', error);
1169+
event.sender.send('launchFolderCompleted', false);
1170+
}
1171+
});
1172+
11531173
ipcMain.on('quit', (event, arg) => {
11541174
app.quit();
11551175
});

0 commit comments

Comments
 (0)