Closed espinielli closed 5 years ago
Something along the lines
get_miniconda_path <- function() {
path <- Sys.getenv("R_MINICONDA_PATH")
if (path != "") {
path <- file.path(path)
if (dir.exists(path)) return(path)
}
# continue with platform specific logic
if (is_windows()) {
...
}
...
}
...
[On a minor note IMHO get_miniconda_path
should not create a "missing" directory ]
Also in install_miniconda
the call to test_miniconda(name)
should use the path
provided as argument too, so to make it work in case of custom installation (and without an R_MINICONDA_PATH
being set up yet)
I will try tp push a PR if there is interest. HTH and thanks for the package...already useful as is BTW!
PR would be great! I thought it was already handling the R_MINICONDA_PATH
- I missed that.
At work, IT allows us to install under
C:\Users\<userid>\dev
, so I installed miniconda via this package as follows:The above installs miniconda in the correct place (with complains):
in fact after having set
R_MINICONDA_PATH
to point toC:/Users/cucu/dev
the following is ok:The problems come from all other functions in the package that take implicitly
path = get_miniconda_path()
, which is not looking intoR_MINICONDA_PATH
but rather in theAPPDATA
(for MS Windows) directory.I think
get_miniconda_path
should check first inR_MINICONDA_PATH
and then failing that in the (platform specific) default location.