Skip to content

Commit b931efc

Browse files
committed
fix dir in contractsDirectory
1 parent 9faf644 commit b931efc

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

lib/core/config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ const Plugins = require('./plugins.js');
44
const utils = require('../utils/utils.js');
55
const path = require('path');
66

7+
const httpContractDir = '.embark/contracts/';
8+
79
var 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;

lib/modules/solidity/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
let async = require('../../utils/async_extend.js');
22
let SolcW = require('./solcW.js');
3-
const path = require('path');
43

54
class Solidity {
65

@@ -26,8 +25,6 @@ class Solidity {
2625
let match = new RegExp("^" + directory);
2726
filename = filename.replace(match, '');
2827
}
29-
// TODO remove this and fix it
30-
filename = path.basename(filename);
3128

3229
file.content(function(fileContent) {
3330
if (!fileContent) {

0 commit comments

Comments
 (0)