% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/hotpatch.R
\name{apply_hotfix_file}
\alias{apply_hotfix_file}
\title{Apply a hotfix file and inject the patch definitions}
\usage{
apply_hotfix_file(file, pkg = NULL)
}
\arguments{
\item{file}{Path to an R script that defines `patch_list` and optionally `pkg`.}

\item{pkg}{Optional package name if not provided in the script.}
}
\value{
Invisibly TRUE on success.
}
\description{
Apply a hotfix file and inject the patch definitions
}
\examples{
# 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")

# Verify the patch works
result <- dummy_parent_func("test")
print(result)

# Clean up
unlink(hotfix_file)
}
