From 73fc72acb7f8a07ea9de5f147f059bc3ffd11517 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Sun, 7 Apr 2019 00:11:26 -0500 Subject: [PATCH] Wait for chmod completion --- electron.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/electron.js b/electron.js index 81f221c..ed58920 100644 --- a/electron.js +++ b/electron.js @@ -524,11 +524,23 @@ ipcMain.on(Constants.IPC_Extract_Release, (event, data) => { .on('finish', () => { stream.close(); if (os.platform() !== 'win32') { - helpers.executeAndWait("chmod +x \"" + path.join(destination, 'repertory') + "\""); + helpers + .executeAndWait("chmod +x \"" + path.join(destination, 'repertory') + "\"") + .then(() => { + standardIPCReply(event, Constants.IPC_Extract_Release_Complete, { + Source: data.Source, + }); + }) + .catch(error => { + standardIPCReply(event, Constants.IPC_Extract_Release_Complete, { + Source: data.Source, + }, error); + }) + } else { + standardIPCReply(event, Constants.IPC_Extract_Release_Complete, { + Source: data.Source, + }); } - standardIPCReply(event, Constants.IPC_Extract_Release_Complete, { - Source: data.Source, - }); }); });