fix: use the right paths since file refactors

This commit is contained in:
Jonathan Rainville 2019-02-28 10:06:49 -05:00
parent 6a34ba8fd8
commit 9ae7192035
1 changed files with 2 additions and 2 deletions

View File

@ -224,7 +224,7 @@ class Flattener {
return callback(null, 'Please make sure you specify the contract name as the class name. E.g. SimpleStorage instead of simple_storage.sol');
}
const flattenedContractFile = path.join(OUTPUT_DIR, contract.filename);
const flattenedContractFile = path.join(OUTPUT_DIR, path.basename(contract.filename));
let flattenedFileExists = false;
if (fs.existsSync(flattenedContractFile)) {
this.logger.info(`Using the already flattened contract (${flattenedContractFile})`);
@ -236,7 +236,7 @@ class Flattener {
if (flattenedFileExists) {
return next();
}
const file = this.embark.config.contractsFiles.find(file => path.normalize(file.path) === path.normalize(contract.originalFilename));
const file = this.embark.config.contractsFiles.find(file => path.normalize(file.path) === path.normalize(contract.filename));
this._doFlatten([file], next);
},
(next) => { // Read the flattened contract