fix coin install bugs
This commit is contained in:
parent
3e456246b0
commit
5cf4ee292a
3 changed files with 5 additions and 8 deletions
|
|
@ -63,7 +63,7 @@ function writeSupervisorConfig (coinRec, cmd) {
|
||||||
const blockchain = coinRec.code
|
const blockchain = coinRec.code
|
||||||
|
|
||||||
const supervisorConfig = `[program:${blockchain}]
|
const supervisorConfig = `[program:${blockchain}]
|
||||||
command=${cmd}
|
command=nice ${cmd}
|
||||||
autostart=true
|
autostart=true
|
||||||
autorestart=true
|
autorestart=true
|
||||||
stderr_logfile=/var/log/supervisor/${blockchain}.err.log
|
stderr_logfile=/var/log/supervisor/${blockchain}.err.log
|
||||||
|
|
@ -99,6 +99,7 @@ function writeFile (path, content) {
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.code === 'EEXIST') {
|
if (err.code === 'EEXIST') {
|
||||||
logger.info(`${path} exists, skipping.`)
|
logger.info(`${path} exists, skipping.`)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
throw err
|
throw err
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ function processCryptos (codes) {
|
||||||
|
|
||||||
function setupCrypto (crypto) {
|
function setupCrypto (crypto) {
|
||||||
logger.info(`Installing ${crypto.display}...`)
|
logger.info(`Installing ${crypto.display}...`)
|
||||||
const cryptoDir = coinUtils.cryptoConfigDir(crypto)
|
const cryptoDir = coinUtils.cryptoDir(crypto)
|
||||||
makeDir.sync(cryptoDir)
|
makeDir.sync(cryptoDir)
|
||||||
const cryptoPlugin = plugin(crypto)
|
const cryptoPlugin = plugin(crypto)
|
||||||
const oldDir = process.cwd()
|
const oldDir = process.cwd()
|
||||||
|
|
@ -85,7 +85,7 @@ function plugin (crypto) {
|
||||||
|
|
||||||
function run () {
|
function run () {
|
||||||
const choices = _.map(c => {
|
const choices = _.map(c => {
|
||||||
const checked = isInstalledSoftware(c) && isInstalledVolume()
|
const checked = isInstalledSoftware(c) && isInstalledVolume(c)
|
||||||
return {
|
return {
|
||||||
name: c.display,
|
name: c.display,
|
||||||
value: c.code,
|
value: c.code,
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ const CRYPTO_CURRENCIES = [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
module.exports = {buildUrl, cryptoDir, cryptoConfigDir, cryptoCurrencies, getCryptoCurrency}
|
module.exports = {buildUrl, cryptoDir, cryptoCurrencies, getCryptoCurrency}
|
||||||
|
|
||||||
function getCryptoCurrency (cryptoCode) {
|
function getCryptoCurrency (cryptoCode) {
|
||||||
const cryptoCurrency = _.find(['cryptoCode', cryptoCode], CRYPTO_CURRENCIES)
|
const cryptoCurrency = _.find(['cryptoCode', cryptoCode], CRYPTO_CURRENCIES)
|
||||||
|
|
@ -81,7 +81,3 @@ function cryptoDir (cryptoRec) {
|
||||||
return path.resolve(blockchainDir, code)
|
return path.resolve(blockchainDir, code)
|
||||||
}
|
}
|
||||||
|
|
||||||
function cryptoConfigDir (cryptoRec) {
|
|
||||||
const configFile = cryptoRec.configFile
|
|
||||||
return path.resolve(cryptoDir(cryptoRec), configFile)
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue