Skip to content

Commit

Permalink
fix: add message for missing environment in list_packages. Closes #21
Browse files Browse the repository at this point in the history
  • Loading branch information
luciorq committed Nov 29, 2024
1 parent a25ba3e commit 7aa1ada
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: condathis
Title: Run Any CLI Tool on a Conda Environment
Version: 0.0.7
Version: 0.0.7.9001
Authors@R: c(
person("Lucio", "Queiroz", , "[email protected]", role = c("aut", "cre", "cph"),
comment = c(ORCID = "0000-0002-6090-1834")),
Expand Down
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# condathis 0.0.8

## Breaking changes

## New features

## Minor improvements and fixes

* Improved error message in `list_packages()`when env don't exist (#21).

# condathis 0.0.7

## New features
Expand Down
10 changes: 10 additions & 0 deletions R/list_packages.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@
#' }
#' @export
list_packages <- function(env_name = "condathis-env", verbose = "silent") {
if (isFALSE(env_exists(env_name))) {
cli::cli_abort(
message = c(
`x` = "Environment {.field {env_name}} do not exist.",
`!` = "Check {.code list_envs()} for available environments."
),
class = "condathis_list_packages_missing_env"
)
}

px_res <- native_cmd(
conda_cmd = "list",
conda_args = c(
Expand Down

0 comments on commit 7aa1ada

Please sign in to comment.