Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
Fix runWithTruffle promise resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
facuspagnuolo committed Dec 19, 2018
1 parent 38867fd commit 6e4258c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/cli/src/utils/runWithTruffle.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ function initTruffle(config) {
const TruffleEnvironment = require('truffle-core/lib/environment')
TruffleEnvironment.detect(config, function (error) {
if (error) reject(error)
const Web3 = require('web3')
const { provider, resolver } = Truffle.setNonceTrackerIfNeeded(config)
global.web3 = new Web3(provider)
global.artifacts = resolver
resolve()
else {
const Web3 = require('web3')
const { provider, resolver } = Truffle.setNonceTrackerIfNeeded(config)
global.web3 = new Web3(provider)
global.artifacts = resolver
resolve()
}
})
});
}
Expand Down

0 comments on commit 6e4258c

Please sign in to comment.