From 44ed8e57e302e7530bffd7f0fd0cd9f1f22d1329 Mon Sep 17 00:00:00 2001 From: pat-s Date: Sat, 14 Mar 2020 10:15:37 +0100 Subject: [PATCH] force add docs/ and add docs/ to .gitignore --- .gitignore | 1 + R/steps-git.R | 6 ++++-- R/use_tic.R | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f01c9c5a..8df6e221 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ inst/doc .DS_Store .vscode tests/testthat/tic +docs/ diff --git a/R/steps-git.R b/R/steps-git.R index ea70d00a..ed474784 100644 --- a/R/steps-git.R +++ b/R/steps-git.R @@ -258,13 +258,15 @@ DoPushDeploy <- R6Class( commit = function() { message("Staging: ", paste(private$commit_paths, collapse = ", ")) - git2r::add(private$git$get_repo(), private$commit_paths) + git2r::add(private$git$get_repo(), private$commit_paths, force = TRUE) message("Checking changed files") status <- git2r::status( private$git$get_repo(), staged = TRUE, - unstaged = FALSE, untracked = FALSE, ignored = FALSE + unstaged = FALSE, + untracked = FALSE, + ignored = FALSE ) if (length(status$staged) == 0) { message("Nothing to commit!") diff --git a/R/use_tic.R b/R/use_tic.R index afa89690..63a3badf 100644 --- a/R/use_tic.R +++ b/R/use_tic.R @@ -412,6 +412,10 @@ use_tic_r <- function(repo_type, deploy_on = "none") { cli_end() cli_h2("tic.R") + # if deploy is requested, we most likely build a pkgdown site and should + # ignore "docs/" here + usethis::use_git_ignore("docs/") + if (repo_type == "unknown") { use_tic_template(file.path( repo_type,