Skip to content

Commit

Permalink
Update fetchers.R
Browse files Browse the repository at this point in the history
  • Loading branch information
b-rodrigues authored Jan 9, 2025
1 parent 23a5e18 commit 432464b
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions R/fetchers.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ fetchgit <- function(git_pkg) {
remotes
)

if (is.null(remotes) | (is.list(remotes) & length(remotes) == 0)) {
# if no remote dependencies: can be NULL if nix_hash runs locally
# but will be empty list if nix_hash runs on the api
if (is.list(remotes) & length(remotes) == 0) {
# if no remote dependencies

output <- main_package_expression
} else { # if there are remote dependencies, start over
Expand All @@ -45,15 +44,24 @@ fetchgit <- function(git_pkg) {
output
}


#' generate_git_nix_expression Generate Nix expression for fetchgit()
#' @param package_name A character, Git package name.
#' @param repo_url A character, Git repo url.
#' @param commit A character, Git commit.
#' @param sri_hash A character, hash of Git repo.
#' @param imports A list of pcakages, can be empty list
#' @param remotes A list of remotes dependencies, can be empty list
#' @return A character. Part of the Nix definition to download and build the R package
#' from the CRAN archives.
#' @noRd
generate_git_nix_expression <- function(package_name,
repo_url,
commit,
sri_hash,
imports,
remote_deps = NULL) {
remotes = NULL) {
# If there are remote dependencies, pass this string
flag_remote_deps <- if (is.null(remote_deps)) {
flag_remote_deps <- if (is.list(remotes) & length(remotes) == 0) {
""
} else {
# Extract package names
Expand Down

0 comments on commit 432464b

Please sign in to comment.