@@ -4,6 +4,8 @@ const Plugins = require('./plugins.js');
44const utils = require ( '../utils/utils.js' ) ;
55const path = require ( 'path' ) ;
66
7+ const httpContractDir = '.embark/contracts/' ;
8+
79var Config = function ( options ) {
810 this . env = options . env ;
911 this . blockchainConfig = { } ;
@@ -188,8 +190,7 @@ Config.prototype.loadExternalContractsFiles = function() {
188190 }
189191 if ( contract . file . startsWith ( 'http' ) || contract . file . startsWith ( 'git' ) ) {
190192 const url = this . getExternalContractUrl ( contract ) ;
191- // TODO put directory name somewhere else
192- const localFile = utils . joinPath ( process . cwd ( ) , '.embark/contracts' , path . basename ( url ) ) ;
193+ const localFile = httpContractDir + path . basename ( url ) ;
193194 this . contractsFiles . push ( new File ( { filename : localFile , type : "http" , basedir : '' , path : url } ) ) ;
194195 } else if ( fs . existsSync ( contract . file ) ) {
195196 this . contractsFiles . push ( new File ( { filename : contract . file , type : "dapp_file" , basedir : '' , path : contract . file } ) ) ;
@@ -258,6 +259,7 @@ Config.prototype.loadEmbarkConfigFile = function() {
258259 } ) . map ( ( dir ) => {
259260 return dir . split ( "*." ) [ 0 ] ;
260261 } ) ;
262+ this . contractDirectories . push ( httpContractDir ) ;
261263
262264 this . buildDir = this . embarkConfig . buildDir ;
263265 this . configDir = this . embarkConfig . config ;
0 commit comments