diff --git a/lib/core/config.js b/lib/core/config.js index c675c1e8..24f0ef9d 100644 --- a/lib/core/config.js +++ b/lib/core/config.js @@ -4,6 +4,8 @@ const Plugins = require('./plugins.js'); const utils = require('../utils/utils.js'); const path = require('path'); +const httpContractDir = '.embark/contracts/'; + var Config = function(options) { this.env = options.env; this.blockchainConfig = {}; @@ -188,8 +190,7 @@ Config.prototype.loadExternalContractsFiles = function() { } if (contract.file.startsWith('http') || contract.file.startsWith('git')) { const url = this.getExternalContractUrl(contract); - // TODO put directory name somewhere else - const localFile = utils.joinPath(process.cwd(), '.embark/contracts', path.basename(url)); + const localFile = httpContractDir + path.basename(url); this.contractsFiles.push(new File({filename: localFile, type: "http", basedir: '', path: url})); } else if (fs.existsSync(contract.file)) { this.contractsFiles.push(new File({filename: contract.file, type: "dapp_file", basedir: '', path: contract.file})); @@ -258,6 +259,7 @@ Config.prototype.loadEmbarkConfigFile = function() { }).map((dir) => { return dir.split("*.")[0]; }); + this.contractDirectories.push(httpContractDir); this.buildDir = this.embarkConfig.buildDir; this.configDir = this.embarkConfig.config; diff --git a/lib/modules/solidity/index.js b/lib/modules/solidity/index.js index 2048b27d..424ab59d 100644 --- a/lib/modules/solidity/index.js +++ b/lib/modules/solidity/index.js @@ -1,6 +1,5 @@ let async = require('../../utils/async_extend.js'); let SolcW = require('./solcW.js'); -const path = require('path'); class Solidity { @@ -26,8 +25,6 @@ class Solidity { let match = new RegExp("^" + directory); filename = filename.replace(match, ''); } - // TODO remove this and fix it - filename = path.basename(filename); file.content(function(fileContent) { if (!fileContent) {