Browse Source

set komodod on app start

all-modes
pbca26 8 years ago
parent
commit
2b84eaca50
  1. 4
      main.js
  2. 30
      routes/shepherd.js

4
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.writeLog('app started in ' + (appConfig.dev ? 'dev mode' : ' user mode'));
shepherd.setConfKMD();
if (appConfig.killIguanaOnStart) { if (appConfig.killIguanaOnStart) {
var iguanaGrep; var iguanaGrep;
@ -357,7 +359,7 @@ function createWindow (status) {
if (appConfig.edexGuiOnly) { if (appConfig.edexGuiOnly) {
if (appConfig.v2) { if (appConfig.v2) {
shepherd.writeLog('show edex gui'); 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'); //mainWindow.loadURL('http://' + appConfig.host + ':' + appConfig.iguanaAppPort + '/gui/EasyDEX-GUI/react/build');
} else { } else {
shepherd.writeLog('show edex gui'); shepherd.writeLog('show edex gui');

30
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) { function setConf(flock) {
console.log(flock); console.log(flock);
shepherd.writeLog('setconf ' + flock); shepherd.writeLog('setconf ' + flock);
@ -1211,6 +1240,7 @@ function setConf(flock) {
break; break;
default: default:
var DaemonConfPath = komodoDir + '/' + flock + '/' + flock + '.conf'; var DaemonConfPath = komodoDir + '/' + flock + '/' + flock + '.conf';
if (os.platform() === 'win32') { if (os.platform() === 'win32') {
DaemonConfPath = path.normalize(DaemonConfPath); DaemonConfPath = path.normalize(DaemonConfPath);
} }

Loading…
Cancel
Save