diff --git a/main.js b/main.js index e1d4560..b95fcad 100644 --- a/main.js +++ b/main.js @@ -58,6 +58,8 @@ var appConfig = shepherd.loadLocalConfig(); // load app config shepherd.writeLog('app started in ' + (appConfig.dev ? 'dev mode' : ' user mode')); +shepherd.setConfKMD(); + if (appConfig.killIguanaOnStart) { var iguanaGrep; @@ -357,7 +359,7 @@ function createWindow (status) { if (appConfig.edexGuiOnly) { if (appConfig.v2) { shepherd.writeLog('show edex gui'); - mainWindow.loadURL('http://127.0.0.1:3000'); + mainWindow.loadURL('http://127.0.0.1:3000'); //mainWindow.loadURL('http://' + appConfig.host + ':' + appConfig.iguanaAppPort + '/gui/EasyDEX-GUI/react/build'); } else { shepherd.writeLog('show edex gui'); diff --git a/routes/shepherd.js b/routes/shepherd.js index aba6146..60c9e15 100644 --- a/routes/shepherd.js +++ b/routes/shepherd.js @@ -1177,6 +1177,35 @@ function slayer(flock) { }); } +shepherd.setConfKMD = function() { + if (os.platform() === 'darwin') { + var komodoDir = process.env.HOME + '/Library/Application Support/Komodo', + ZcashDir = process.env.HOME + '/Library/Application Support/Zcash'; + } + + if (os.platform() === 'linux') { + var komodoDir = process.env.HOME + '/.komodo', + ZcashDir = process.env.HOME + '/.zcash'; + } + + if (os.platform() === 'win32') { + var komodoDir = process.env.APPDATA + '/Komodo', + ZcashDir = process.env.APPDATA + '/Zcash'; + } + + // check if kmd conf exists + _fs.access(komodoDir + '/komodo.conf', fs.constants.R_OK, function(err) { + if (err) { + console.log('creating komodo conf'); + shepherd.writeLog('creating komodo conf in ' + komodoDir + '/komodo.conf'); + setConf('komodod'); + } else { + shepherd.writeLog('komodo conf exists'); + console.log('komodo conf exists'); + } + }); +} + function setConf(flock) { console.log(flock); shepherd.writeLog('setconf ' + flock); @@ -1211,6 +1240,7 @@ function setConf(flock) { break; default: var DaemonConfPath = komodoDir + '/' + flock + '/' + flock + '.conf'; + if (os.platform() === 'win32') { DaemonConfPath = path.normalize(DaemonConfPath); }