Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eycorsican committed Mar 8, 2020
1 parent 1f9565b commit 071d1d4
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/helper/darwin/install_helper
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ chown root "$INSTALL_PATH/route"
chmod +s "$INSTALL_PATH/core"
chmod +s "$INSTALL_PATH/md5sum"
chmod +s "$INSTALL_PATH/route"

chmod +x "$INSTALL_PATH/core"
chmod +x "$INSTALL_PATH/md5sum"
chmod +x "$INSTALL_PATH/route"
4 changes: 4 additions & 0 deletions src/helper/linux/install_helper
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ chown root "$INSTALL_PATH/ip"
chmod +s "$INSTALL_PATH/core"
chmod +s "$INSTALL_PATH/md5sum"
chmod +s "$INSTALL_PATH/ip"

chmod +x "$INSTALL_PATH/core"
chmod +x "$INSTALL_PATH/md5sum"
chmod +x "$INSTALL_PATH/ip"
23 changes: 23 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ if (app.isPackaged) {

var helperInstallPath
var helperFiles
var executableHelperFiles
switch (process.platform) {
case 'darwin':
helperInstallPath = "/Library/Application Support/Mellow"
Expand All @@ -175,6 +176,11 @@ switch (process.platform) {
'md5sum',
'route'
]
executableHelperFiles = [
'core',
'md5sum',
'route'
]
break
case 'linux':
helperInstallPath = '/usr/local/mellow'
Expand All @@ -185,6 +191,11 @@ switch (process.platform) {
'md5sum',
'ip'
]
executableHelperFiles = [
'core',
'md5sum',
'ip'
]
break
}

Expand Down Expand Up @@ -357,6 +368,15 @@ function checkHelper() {
}
}
}
for (let f of executableHelperFiles) {
installedFile = path.join(helperInstallPath, f)
try {
execSync(util.format('sh -c "[ -x \'%s\' ]"', installedFile))
} catch (err) {
log.info('File requires execute permission', installedFile)
return false
}
}
return true
}

Expand Down Expand Up @@ -558,6 +578,9 @@ async function startCore(callback) {
log.info('Core errored.')
coreInterrupt = true
core = null
if ((isDarwin || isWin32) && store.get('systemProxy')) {
configureSystemProxy(false)
}
setState(state.Disconnected)
log.info(err)
dialog.showErrorBox('Error', util.format('Failed to start the Core, see "%s" for more details.', logPath))
Expand Down

0 comments on commit 071d1d4

Please sign in to comment.