feat: update btcd after installing

This commit is contained in:
José Oliveira 2021-08-29 19:51:05 +01:00
parent 5add544ad7
commit 24acfcbf6a
3 changed files with 49 additions and 6 deletions

View file

@ -69,6 +69,8 @@ function processCryptos (codes) {
) | crontab -`
common.es(rsyncCmd)
_.forEach(updateCrypto, selectedCryptos)
logger.info('Installation complete.')
}
@ -91,6 +93,12 @@ function setupCrypto (crypto) {
process.chdir(oldDir)
}
function updateCrypto (crypto) {
if (!common.isUpdateDependent(crypto)) return
const cryptoPlugin = plugin(crypto)
cryptoPlugin.updateCore(common.getBinaries(crypto))
}
function plugin (crypto) {
const plugin = PLUGINS[crypto.cryptoCode]
if (!plugin) throw new Error(`No such plugin: ${crypto.cryptoCode}`)