-
-
Notifications
You must be signed in to change notification settings - Fork 362
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
update default exercism assignment path to ~/exercism #97
Conversation
Returning a blank string if the user has an incorrectly setup environment could mean we puts things in unexpected places.
There is no longer any errors to return, so I've remove the error from the method signature.
This allows us to set a home directory when testing, which makes it easier to work with tests that depend on its location.
* use config.DefaultAssignmentPath when user input is blank for directory
❤️ I'm stoked to see this, and too fried to think straight. I'll get back to you tomorrow. |
return os.Getenv("HOME") | ||
// TODO should we fall back to the CWD instead ? | ||
if homeDir == "" { | ||
panic("unable to determine the location of your home directory") |
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.
This should be an errors.New()
rather than a panic, and we should handle it in from main()
my informing the user and doing an os.Exit(1)
.
This all looks better than what is there, it's just that as I start thinking about anything in here critically (my code or yours), I come up with things that I dislike, or ideas that I think would be better. |
Thanks for the feedback. I'm out of town until next week. I'll pick this up when I'm back. |
If you're OK with it, I'll pull it in and then tweak it. |
Go for it!
|
update default exercism assignment path to ~/exercism
update default exercism assignment path to ~/exercism
Previously the default path (if none was provided by the user) when logging in defaulted to a folder called exercism in the current working directory. Now the default path is relative to the user's home directory. If the user requests a demo the demo directory will also be relative to the home directory.
Feedback welcome!
Closes #96