coinUtils fixes

This commit is contained in:
Josh Harvey 2017-07-09 13:31:01 +03:00
parent b7aa655587
commit 5a26f718c5
9 changed files with 63 additions and 71 deletions

View file

@ -6,7 +6,6 @@ const makeDir = require('make-dir')
const inquirer = require('inquirer')
const _ = require('lodash/fp')
const options = require('../options')
const coinUtils = require('../coin-utils')
const common = require('./common')
@ -27,7 +26,7 @@ const PLUGINS = {
module.exports = {run}
function installedFilePath (crypto) {
return path.resolve(options.blockchainDir, crypto.code, '.installed')
return path.resolve(coinUtils.cryptoDir(crypto), '.installed')
}
function isInstalled (crypto) {
@ -57,7 +56,7 @@ function processCryptos (codes) {
function setupCrypto (crypto) {
logger.info(`Installing ${crypto.display}...`)
const cryptoDir = path.resolve(options.blockchainDir, crypto.code)
const cryptoDir = coinUtils.cryptoConfigDir(crypto.cryptoCode)
makeDir.sync(cryptoDir)
const cryptoPlugin = plugin(crypto)
const oldDir = process.cwd()