-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Replace std::env::home_dir()
with home
crate impl.
#9293
Conversation
It looks like @c0gent signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
48ce57e
to
3a87d3b
Compare
@tomaka Please let me know what you think about this. I'm guessing |
@niklasad1 this is very similar to your PR from early July that was later reversed because of Android issues I think? I don't remember the conclusion of that though, to hold off? |
Would merging this PR move the base directory of people using Windows? |
What this does is make the home directory more consistent. It's possible that someone running Parity on msys/cygwin could now have a different home folder. I could add some logic on startup to detect this potential condition (under windows) and provide a helpful error message or something. Or just silently move the folder (if none exists in the 'new' location). What do you think? |
@dvdplm This is slightly different instead of using So, my educated guess is that this will work fine on Android (UNIX impl) because it doesn't have any conditional compilation guards to prevent platforms other than Linux, OSX and Windows. (I think the home_dir will be root folder on Android not sure though) But this must absolutely be tested on |
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.
Compiles on android
good enough for me!
But, the PR needs to be rebased/merged to master
* Import the `home` crate in `util/dir`. * Replace uses of `env::home_dir()` with `home::home_dir()`. * `home` uses a 'correct' impl. on windows and the stdlib impl. of `::home_dir` otherwise. * Reexport `home::home_dir` from `util/dir`. * Bump `util/dir` to 0.1.2.
@c0gent can you sort out the merge conflicts so we can merge this please? :) |
275a920
to
ff0ad95
Compare
Done. |
|
Please revert |
Sorry, not sure how that happened... |
Import the
home
crate inutil/dir
.Replace uses of
env::home_dir()
withhome::home_dir()
.home
uses a 'correct' impl. on windows and the stdlib impl. of::home_dir
otherwise.Reexport
home::home_dir
fromutil/dir
.Bump
util/dir
to 0.1.2.Addresses deficiencies of #9077 and #9281. Tested on Linux and Windows.