-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add shell detection #6
Conversation
d0eb83c
to
8a77ce8
Compare
I'm getting an error when it runs, though it does seem to have added the expected lines:
|
userpath/shells.py
Outdated
locations = location.split(pathsep) | ||
|
||
if front: | ||
contents = '\n'.join('$PATH.insert(0, r"{}")'.format(location) for location in reversed(locations)) |
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.
May I suggest {!r}
instead of r"{}"
?
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.
Much nicer, thanks!
@AlJohri @jaraco @cs01 So, here's what I've done:
I'd appreciate it if you could test this once more, then I'll merge and release! |
Looking good!
Couple of comments follow. Should there be output for success? Unix conventions say don't emit anything on success, although maybe that's an old convention. You may be asked later to add a At first, the help text had me thinking that the Windows behavior was unnecessarily special cased. In particular:
This made me think that on Windows, it would attempt to modify the config of all these shells... then I realized that the reason "that is the standard behavior" means that environment settings always affect all shells, not that Overall, no objections. Looks great to me. |
I'll try and test this out early next week- apologies for the delay. |
Resolves #3