This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add --url option to the truffle migrate
command
#5739
Draft
sukanyaparashar
wants to merge
11
commits into
develop
Choose a base branch
from
add-url-to-migrate
base: develop
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7031277
Add --url option to truffle migrate command
sukanyaparashar 89ae0bc
Add integration test for the --url option
sukanyaparashar a386352
Add spacing in the usage section
sukanyaparashar afbeb9c
Use const instead of let
sukanyaparashar 8811d74
Filter url and network options from the REPL input
sukanyaparashar d00ba47
Use makeIIFE function instead of TruffleError
sukanyaparashar d9293fe
Remove extra single quote
sukanyaparashar 9aee86c
Remove extra single quote from develop test case
sukanyaparashar b53f4e7
Add tests to filter url and network options within REPL
sukanyaparashar 1271865
Handle filtering of url and network options
sukanyaparashar 4c94755
Refactor function name to convey its actual meaning
sukanyaparashar File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ const processInput = (input, allowedCommands) => { | |
|
||
if (cmd === undefined) { | ||
return makeIIFE( | ||
`ℹ️ : 'Missing truffle command. Please include a valid truffle command.` | ||
`ℹ️ : Missing truffle command. Please include a valid truffle command.` | ||
); | ||
} | ||
|
||
|
@@ -46,6 +46,16 @@ const processInput = (input, allowedCommands) => { | |
return makeIIFE(`ℹ️ : '${cmd}' is not a valid Truffle command`); | ||
} | ||
|
||
if (words.includes("--url")) { | ||
const message = "url option is not supported within Truffle REPL"; | ||
return makeIIFE(`ℹ️ : ${message}`); | ||
} | ||
|
||
if (words.includes("--network")) { | ||
const message = "network option is not supported within Truffle REPL"; | ||
return makeIIFE(`ℹ️ : ${message}`); | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's add tests for these two There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will add the tests. Thanks @cds-amal. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The tests should cover both logic branches; with and without the |
||
// an expression | ||
return input.trim(); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious about why you prefer
--network
lives here vs with the other global options.Actually, can
url
be a global option as well?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The global options generally appends the options at the end of the usage. The reason behind keeping
--network
and--url
options here rather than in the global options, is to show that they are mutually exclusive.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okie. thank you for the explanation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add a note in each of these letting the user know that these options are mutually exclusive? do you think that would be helpful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usage
section shows that they are mutually exclusive but if adding a note in the descriptions is preferable, then we can add it here too.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whatever you think, I don't feel strongly about it :)