#' @keywords internal
use_gitignore <- function(project = ".") {
proj <- normalizePath(project, mustWork = FALSE)
withr::with_dir(proj, {
file <- ".gitignore"
if (!file.exists(file)) {
writeLines(
con = file,
text = c(
".Rproj.user",
"**.Rproj",
"**.Rhistory",
"**.Rdata",
"core"
)
)
} else {
message(sprintf('"%s" already exists! Nothing was done!', file))
}
})
invisible(TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.