Skip to content

Commit

Permalink
add package name when directory not found (#57)
Browse files Browse the repository at this point in the history
* add package name when directory not found

* upversion and update news
  • Loading branch information
donyunardi authored Jan 25, 2024
1 parent 310f1f7 commit 38f4fc4
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 deletions.
9 changes: 6 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
Package: multiloadr
Type: Package
Title: Load the packages relevant to a project within a session
Version: 0.0.1.9000
Authors@R: person("Dony", "Unardi", email = "[email protected]", role = c("aut", "cre"))
Version: 0.0.2
Authors@R: c(
person("Dony", "Unardi", email = "[email protected]", role = c("aut", "cre")),
person("Vedha", "Viyash", role = "ctb")
)
Description: The purpose of this package is to assist in loading the R packages that serve as
immediate dependencies for the R package currently being worked on. This package is useful for
developing multiple interdependent R packages.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Imports:
devtools,
stats
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# multiloadr 0.0.1.9000
# multiloadr 0.0.2
* Add the load_verbose argument to the load_pkgs function and improve the warning message when multiloadr is unable to switch or pull the targeted branch.
* Add color utilities for messages for consistency.
* Improve message when a package is not added to multiloadr.

# multiloadr 0.0.1

Expand Down
7 changes: 6 additions & 1 deletion R/add_pkgs.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ add_pkgs <- function(pkg_name, path) {
))
}
} else {
cat("Package not added to multiloadr. Directory is not an R package.\n")
cat(paste0(
"\n",
package_name_color(pkg_name),
" not added to multiloadr.",
" The directory path does not exist or is not an R package.\n"
))
}

invisible()
Expand Down
2 changes: 2 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Dony
Unardi
Vedha
Viyash
5 changes: 5 additions & 0 deletions man/multiloadr-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/test-add_list_load_rm_pkgs.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ test_that("add_pkgs, list_pkgs, load_pkgs, rm_pkgs works", {
expect_output(list_pkgs(), "No packages to list.")
expect_output(
add_pkgs("testing", "/path/to/folder"),
"Directory is not an R package"
"directory path does not exist or is not an R package"
)
expect_output(load_pkgs(), "No packages to load")

Expand Down

0 comments on commit 38f4fc4

Please sign in to comment.