From 9ae7192035980ad0e0d0521bd4af5a7b70ffd128 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Thu, 28 Feb 2019 10:06:49 -0500 Subject: [PATCH] fix: use the right paths since file refactors --- lib/Flattener.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Flattener.js b/lib/Flattener.js index 84c253f..48bf667 100644 --- a/lib/Flattener.js +++ b/lib/Flattener.js @@ -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