feat: backport l-c script to install btcd v20 as default and then update to latest

This commit is contained in:
José Oliveira 2021-11-02 21:58:57 +00:00
parent 2e1564c23c
commit adb9be23d6
3 changed files with 48 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.cryptoCode)) return
const cryptoPlugin = plugin(crypto)
cryptoPlugin.updateCore(common.getBinaries(crypto.cryptoCode))
}
function plugin (crypto) {
const plugin = PLUGINS[crypto.cryptoCode]
if (!plugin) throw new Error(`No such plugin: ${crypto.cryptoCode}`)