Commit dd4b1aa4 authored by aniket-engg's avatar aniket-engg Committed by Aniket

avoid duplicate error logs

parent b0671004
......@@ -24,7 +24,6 @@ export class HardhatClient extends PluginClient {
return new Promise((resolve, reject) => {
if (this.readOnly) {
const errMsg = '[Hardhat Compilation]: Cannot compile in read-only mode'
console.log('\x1b[31m%s\x1b[0m', `${errMsg}`)
return reject(new Error(errMsg))
}
const cmd = `npx hardhat compile --config ${configPath}`
......@@ -38,8 +37,7 @@ export class HardhatClient extends PluginClient {
result += msg + '\n'
})
child.stderr.on('data', (err) => {
console.log('\x1b[31m%s\x1b[0m', `[Hardhat Compilation]: ${err.toString()}`)
error += err.toString()
error += `[Hardhat Compilation]: ${err.toString()}`
})
child.on('close', () => {
if (error) reject(error)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment