Skip to content

Commit fa7ca78

Browse files
committed
restrict the deletion to bookdown.org records only: #1512 (comment)
1 parent bb718ff commit fa7ca78

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

R/publish.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ publish_book = function(name = NULL, ...) {
2323
if (x1) rsconnect::removeAccount(server = 'bookdown.org')
2424
if (x2) rsconnect::removeServer('bookdown.org')
2525
}
26-
if (readline('Do you want to delete local records of the Connect deployment? Your book will _not_ be deleted (y/n) ') == 'y') {
27-
rsconnect::forgetDeployment()
26+
if (file.exists(d <- 'rsconnect/documents/index.Rmd/bookdown.org') &&
27+
readline('Do you want to delete local records of the bookdown.org deployment? Your book will _not_ be deleted (y/n) ') == 'y') {
28+
unlink(d, recursive = TRUE)
2829
}
2930
}
3031
# if no accounts other than shinyapps.io and bookdown.org have been set up on

0 commit comments

Comments
 (0)