-
Notifications
You must be signed in to change notification settings - Fork 2
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
Comments on remote configuration #31
Comments
|
how do you tell if a remote was moved or the config is wrong? |
RE 1: config is read in a package |
RE 2: in light of the #28, I have removed the concept of default remote altogether. The only command that needs it is the push and it makes more sense to make the default flag mandatory for push, unless there's only one remote configured. |
RE 3: I have added a check in FileRemote, which validates before list, versions, and fetch, that the configured root exists and is a directory. I don't know if there's a better way to deal with a moved/deleted directory. |
…ig-errmessages - feat: remove concept of default remote in favor of explicit setting where necessary - chore: improve some error messages, e.g. those mentioned in #31 - fix: make remote.saveConfig() save only the remotes part to config - test: make logger setup tests independent of config file in user's home dir
@alexbrdn Testing the remote handling in the CLI:
Why use a panic, when the configuration cannot be read? A CLI can exit and a server can refuse to start. An unreadable config is an external error, which doesn't seem to warrant a panic, no? It just dumps a stack trace on the terminal, which could be a nice error message.
https://github.com/web-of-things-open-source/tm-catalog-cli/blob/71ec3a6ecced7e205172b704c20bfaedcd49ff4f/main.go#L44
If you agree, I'd like to improve the error message for the case of multiple remotes with no default. I suggest:
"push failed: multiple remotes configured, but remote target not specified and no default remote set."
Otherwise it looks quite good already.
The text was updated successfully, but these errors were encountered: