update blockchain install

This commit is contained in:
Josh Harvey 2017-07-12 15:07:13 +03:00
parent 4affb11ba2
commit 8b7a391b41
3 changed files with 30 additions and 10 deletions

View file

@ -25,12 +25,16 @@ const PLUGINS = {
module.exports = {run}
function installedFilePath (crypto) {
function installedVolumeFilePath (crypto) {
return path.resolve(coinUtils.cryptoDir(crypto), '.installed')
}
function isInstalled (crypto) {
return fs.existsSync(installedFilePath(crypto))
function isInstalledVolume (crypto) {
return fs.existsSync(installedVolumeFilePath(crypto))
}
function isInstalledSoftware (crypto) {
return common.isInstalledSoftware(crypto)
}
function processCryptos (codes) {
@ -67,7 +71,7 @@ function setupCrypto (crypto) {
common.es('rm -rf *')
common.fetchAndInstall(crypto)
cryptoPlugin.setup(cryptoDir)
fs.writeFileSync(installedFilePath(crypto), '')
fs.writeFileSync(installedVolumeFilePath(crypto), '')
process.chdir(oldDir)
}
@ -79,7 +83,7 @@ function plugin (crypto) {
function run () {
const choices = _.map(c => {
const checked = isInstalled(c)
const checked = isInstalledSoftware(c) && isInstalledVolume()
return {
name: c.display,
value: c.code,