specify output directory when build
This commit is contained in:
1 parent
8e43285089
commit
95689ec712
4 files changed
+49
-34
No files matched your search
+12
-2
@@ -20,6 +20,7 @@ export default class AppMenu {
|
||||
private mainWindow: BrowserWindow;
|
||||
private webContents: WebContents;
|
||||
private settings: Settings;
|
||||
private buildDir?: string;
|
||||
|
||||
constructor(mainProcess: MainProcess) {
|
||||
this.mainProcess = mainProcess;
|
||||
@@ -139,8 +140,17 @@ export default class AppMenu {
|
||||
{
|
||||
label: "构建",
|
||||
accelerator: "CommandOrControl+b",
|
||||
click: () => {
|
||||
this.webContents.send(MainEventType.BUILD);
|
||||
click: async () => {
|
||||
if (!this.buildDir) {
|
||||
const res = await dialog.showOpenDialog({
|
||||
properties: ["openDirectory"],
|
||||
});
|
||||
if (res.canceled) {
|
||||
return;
|
||||
}
|
||||
this.buildDir = res.filePaths[0];
|
||||
}
|
||||
this.webContents.send(MainEventType.BUILD, this.buildDir);
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user