Skip to content

Keep inst/doc and continue when answering No to the clean_doc prompt - #229

Merged
gaborcsardi merged 1 commit into
r-lib:mainfrom
taekop:fix-clean-doc-no-prompt
Oct 5, 2026
Merged

gaborcsardi merged 1 commit into
r-lib:mainfrom
taekop:fix-clean-doc-no-prompt

Conversation

@taekop

@taekop taekop commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Answering "No" to the interactive "Building the package will delete inst/doc, are you sure?" prompt hits a bare return() in build_setup_source(). That returns NULL to build(), which then fails with an unrelated error:

build(clean_doc = NULL)  # interactive, inst/doc exists, answer 2
#> Error: no("wd") || is_string(wd) is not TRUE

Now "No" (or cancelling the prompt) skips the deletion and the build continues, so inst/doc is kept, matching what clean_doc = FALSE does. Only "Yes" deletes it. The prompt now reads "Delete it and build ('Yes'), or keep it and build ('No')?" so it's clear what each answer does.

The test mocks the prompt through a small is_interactive() wrapper, because mocking base interactive() doesn't take effect once the function has been byte-compiled.

Before/after on 19 build() setups (clean_doc NULL/TRUE/FALSE, Config/build/clean-inst-doc TRUE/FALSE/unset, vignettes on/off, no inst/doc, binary build, interactive Yes/No): the other 18 give identical tarball contents. The one that changes is interactive "No" with nothing configured, which used to error. Full test suite passes.

Closes #186

@gaborcsardi
gaborcsardi merged commit 8b4c0b0 into r-lib:main Oct 5, 2026
19 checks passed
@gaborcsardi

Copy link
Copy Markdown
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handling of interactive No to clean_doc question

2 participants