How can I arrange conditional branching in truffle migration based on the chosen of the network for migration(development, ropsten, main, etc) or based on the Linux environment variables?
1 Answer
The signature of the migration script function is:
module.exports = function (deployer, network, accounts) {
...
}
If you want to branch depending on which network you are, you can check the network parameter.
If you wish to use environment variables, you can access these via process.env.<VARIABLE>
.