Skip to content

Commit 6f63e5a

Browse files
authored
fix feature about revealProjectFiles (#437)
1 parent 6ac0d5a commit 6f63e5a

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

frontend/app.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,9 @@ function setup() {
535535
// update link to local project files
536536
$("#revealProjectFiles").prop('href', 'file:///' + path.join(project.projectPath, project.projectName).replace(/^\//, '') );
537537
}).trigger('change');
538+
$('#revealProjectFiles').click(() => {
539+
ipcRenderer.send('showItemInFolder', $('#revealProjectFiles').prop('href'));
540+
});
538541

539542
$("#projectName").on('focusout', () => {
540543
$("#projectName").trigger('change');

frontend/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,10 +1171,14 @@ ipcMain.on('getOSInfo', (event) => {
11711171
};
11721172
});
11731173

1174-
ipcMain.on('openExternal', (event, [ url ]) => {
1174+
ipcMain.on('openExternal', (event, url) => {
11751175
shell.openExternal(url);
11761176
});
11771177

1178+
ipcMain.on('showItemInFolder', (event, p) => {
1179+
shell.showItemInFolder(p);
1180+
});
1181+
11781182
ipcMain.on('firstTimeSierra', (event, command) => {
11791183
exec(command, (error, stdout, stderr) => {
11801184
console.log(stdout, stderr);

frontend/preload.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ contextBridge.exposeInMainWorld('ipc_wrapper', {
1414
},
1515
fs: {
1616
existsSync: (p) => ipcRenderer.sendSync('fs', ['existsSync', [p]]),
17-
}
17+
},
18+
openExternal: (url) => ipcRenderer.sendSync('openExternal', url),
19+
showItemInFolder: (p) => ipcRenderer.sendSync('showItemInFolder', p),
1820
});

0 commit comments

Comments
 (0)