From cc88b846aad5497df84d9bb81bf62bf8f563a860 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 17 Oct 2018 15:08:36 -0400 Subject: [PATCH] use embark config to get contracts dir --- lib/modules/scaffolding-solidity/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/modules/scaffolding-solidity/index.js b/lib/modules/scaffolding-solidity/index.js index 0a05b71a..cee62dcf 100644 --- a/lib/modules/scaffolding-solidity/index.js +++ b/lib/modules/scaffolding-solidity/index.js @@ -13,7 +13,9 @@ class ScaffoldingSolidity { _generateFile(contract, templateFilename, extension, data, overwrite){ const filename = capitalize(contract.className.toLowerCase()) + '.' + extension; - const filePath = './contracts/' + filename; + const contractDirs = this.embark.config.embarkConfig.contracts; + const contractDir = Array.isArray(contractDirs) ? contractDirs[0] : contractDirs; + const filePath = fs.dappPath(contractDir.replace(/\*/g, ''), filename); if (!overwrite && fs.existsSync(filePath)){ throw new Error("file '" + filePath + "' already exists"); }