Skip to content

Commit

Permalink
Always alow to provide --network flag if running the contracts command (
Browse files Browse the repository at this point in the history
#247)

* Always alow to provide --network flag if running the contracts command
  • Loading branch information
izqui authored Oct 23, 2018
1 parent 7d6ea95 commit 0634a50
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/middleware/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ module.exports = function environmentMiddleware (argv) {
const { reporter, module, apm } = argv
let { environment, network } = argv

if (environment && network) {
const isTruffleFwd = argv._[0] === 'contracts'

if (environment && network && !isTruffleFwd) {
reporter.error('Arguments \'--network\' and \'--environment\' are mutually exclusive. Using \'--network\' has been deprecated and \'--environment\' should be used instead.')
process.exit(1)
}

if (!runsInCwd && module) {
if (network && module.environments) {
if (network && module.environments && !isTruffleFwd) {
reporter.error(
'Your arapp.json contains an `environments` property. The use of \'--network\' is deprecated and \'--environment\' should be used instead.'
)
Expand Down

0 comments on commit 0634a50

Please sign in to comment.