Skip to content

Commit

Permalink
deps:: defaults to package inside packages
Browse files Browse the repository at this point in the history
Otherwise it scans dependencies.
  • Loading branch information
gaborcsardi committed Nov 8, 2024
1 parent 7d901fc commit 50efafa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion R/type-deps.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ parse_remote_deps <- function(specs, config, ...) {
resolve_remote_deps <- function(remote, direct, config, cache,
dependencies, ...) {

if (file.exists(file.path(remote$path, "DESCRIPTION"))) {
in_pkg <- tryCatch(find_package_root(remote$path), error = function(x) NULL)
if (!is.null(in_pkg)) {
ret <- resolve_remote_local(remote, direct, config, cache,
dependencies, ...)
} else {
Expand Down Expand Up @@ -67,6 +68,12 @@ resolve_remote_local_autodeps <- function(remote, direct, config, cache,
dsc <- desc::desc("!new")
hard <- deps$package[deps$type == "prod"]
soft <- deps$package[deps$type != "prod"]
dsc$set(
Package = "localprojectautoscan",
Version = "1.0.0",
Title = "Local Project",
License = "Unknown"
)
for (p in hard) dsc$set_dep(p, type = "Depends")
for (s in soft) dsc$set_dep(p, type = "Suggests")
dsc$write(tmpdesc)
Expand Down

0 comments on commit 50efafa

Please sign in to comment.