1212# ' }
1313conda <- function (suffix_params = " " , prefix_params = " " , conda = Sys.which(' conda' ), ... ) {
1414 conda <- unname(conda )
15- if (conda == " " ) stop (" Executable 'conda' Not Found." )
15+ if (conda == " " ) {warning (" Executable 'conda' Not Found." ); return ( FALSE )}
1616 objs <- system(sprintf(" %s%s %s" , prefix_params , conda , suffix_params ), intern = TRUE , ... )
1717 x <- paste0(objs , collapse = " \n " )
1818 return (x )
@@ -32,6 +32,7 @@ conda <- function(suffix_params = "", prefix_params = "", conda = Sys.which('con
3232conda.list <- function (env_name = " base" , ... ) {
3333 if (! is.null(env_name ) && env_name != " " ) objs <- conda(" list" , prefix_params = sprintf(" source activate %s;" , env_name ), ... )
3434 if (is.null (env_name ) || env_name == " " ) objs <- conda(" list" , ... )
35+ if (is.logical(objs ) && ! objs ) {return (FALSE )}
3536 text <- paste0(objs , collapse = " \n " )
3637 x <- tryCatch(read.table(text = text ), error = function (e ) {
3738 data.frame ()
@@ -53,6 +54,7 @@ conda.list <- function(env_name = "base", ...) {
5354# ' }
5455conda.env.list <- function (... ) {
5556 objs <- conda(" env list" , ... )
57+ if (is.logical(objs ) && ! objs ) {return (FALSE )}
5658 text <- paste0(objs , collapse = " \n " )
5759 x <- read.table(text = str_replace(text , " [*] " , " " ), skip = 2 )
5860 colnames(x ) <- c(" env_name" , " env_path" )
0 commit comments