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"); }