remotes icon indicating copy to clipboard operation
remotes copied to clipboard

local_package_deps: throw clear warning when `pkgdir` is not valid?

Open MatthieuStigler opened this issue 2 years ago • 2 comments

This is a small detail, but it would be nice to have local_package_deps fail in a cleaner way when pkgdir is not found?

Currently, this triggers the correct message, but only as warning, then triggering a subsequent error:

#> Warning in normalizePath(path): path[1]="wrongpath": No such file or directory #> Error in if (!is_dir(path)) {: missing value where TRUE/FALSE needed

library(remotes)
packageVersion("remotes")
#> [1] '2.4.2.9000'
local_package_deps("wrongpath")
#> Warning in normalizePath(path): path[1]="wrongpath": No such file or directory
#> Error in if (!is_dir(path)) {: missing value where TRUE/FALSE needed

Created on 2023-05-10 with reprex v2.0.2

MatthieuStigler avatar May 10 '23 09:05 MatthieuStigler

A PR is welcome!

gaborcsardi avatar Nov 01 '23 14:11 gaborcsardi

ok, just added mustWork = TRUE in normalizePath, now warning becomes error

MatthieuStigler avatar Nov 02 '23 08:11 MatthieuStigler