-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iss#6: implemented logic to determine how skywire-updater finds config file. #7
Merged
Merged
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a0b126a
issue#6 - Implement services to find a config file path based on the …
atang152 01a23f1
Added preliminary unit test- configpath_test.go
atang152 e304b59
minor changes to configpath_test.go. Only testing one case where defa…
atang152 20afb99
issue#6 - Refractor skywire-update. 'Invalid command' was returned wh…
atang152 4c1cb9c
Merge branch 'develop_v2' into develop
atang152 45523fb
[WIP] fixing pr#7. make install-linters seems to fail with go1.11 an…
atang152 ae619a9
issue#6 - fixed changes requested from code review for pr#7.
atang152 23e342f
minor changes to .gitignore to exclude .vscode
atang152 871285b
minor changes to .gitignore to exclude .vscode
atang152 3417a45
Fixed import and code to read in [config] via CLI
atang152 4da33ac
Delete pathutil/homedir path & ran go mod vendor
atang152 d790c6b
Ran goimports and minor edit to Makefile
atang152 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ | |
*.out | ||
.idea/ | ||
coverage/ | ||
db.json | ||
db.json | ||
.vscode/ |
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 |
---|---|---|
|
@@ -15,6 +15,7 @@ install-linters: ## Install linters | |
# For some reason this install method is not recommended, see https://github.com/golangci/golangci-lint#install | ||
# However, they suggest `curl ... | bash` which we should not do | ||
GO111MODULE=on go get -u github.com/golangci/golangci-lint/cmd/golangci-lint | ||
# GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/[email protected] | ||
|
||
format: ## Formats the code. Must have goimports installed (use make install-linters). | ||
GO111MODULE=on goimports -w -local github.com/watercompany/skywire-updater ./pkg | ||
|
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
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
Oops, something went wrong.
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 would prefer it if we read the
[config-file]
via a CLI flag, instead of a new sub-command. 😜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.
Thank you! I was thinking to use CLI flags originally too; I will go back and review the code again and see if I could make this change. Thank you!
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.
Hi Evan. I made a change to the code. It can now reads in [config-file] via CLI flag instead of having to type a new Cobra subcommand. It turns out that by default Cobra only parses local flags on the target command, any local flags on parent commands are ignored. So by enabling this argument Command.TraverseChildren allows Cobra to parse local flags on each command before executing the target command. Please let me know if this logic is okay. Thanks!