apply_hotfix_file.RdApply a hotfix file and inject the patch definitions
apply_hotfix_file(file, pkg = NULL)Invisibly TRUE on success.
# Create a temporary hotfix file
hotfix_content <- "
pkg <- 'hotpatchR'
patch_list <- list(
dummy_child_func = function(x) {
paste('HOTFIXED! Input:', x)
}
)
"
hotfix_file <- tempfile(fileext = ".R")
writeLines(hotfix_content, hotfix_file)
# Apply the hotfix from file
apply_hotfix_file(file = hotfix_file, pkg = "hotpatchR")
#> Successfully applied hotfix to package: hotpatchR
# Verify the patch works
result <- dummy_parent_func("test")
print(result)
#> [1] "Parent output -> HOTFIXED! Input: test"
# Clean up
unlink(hotfix_file)