I'm writing a script to be executed with truffle exec
and I need to add some logic conditional on the network we're calling truffle exec
with.
This is (roughly) what I want in my script:
const contract = artifacts.require("./MyContract.sol");
module.exports = function(callback) {
// TODO: Do some conditional thing based on network!
contract.callMethod();
}
I'm hoping to call this script in the following way:
truffle exec script.js --network ropsten