Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Allow user to decline to overwrite existing file, from use_template() #348
Is there any appetite for a PR that would add a
The context is that we have a series of templates (CoC, README, etc) where a user, when setting up a project or package, may accept the template for some and keep existing files for others. Since
I agree it makes sense to be able to opt-out of overwrite and not throw an error. However, my mind is very much elsewhere right now.
Before making a PR, will you give a few bullet points re: what you plan to do so @hadley can also give a quick
The objective is to make sure the change really needs to happen in usethis vs. in your package (without forcing you to do some awkward
Definitely where I am at right now
Ok here is a shot at what I would try:
…tead of an error. Closes r-lib#348
…e an existing file and instead produces a message (#350) * a negative user response to overwriting a file produces a message instead of an error. Closes #348 * only modify if open = TRUE and the file is actually created * modify test_that names to reflect warnings * use longer form comparison * skip R 3.1 when testing message for use_readme overwrite * Tweak docs Also a test to see if I can push to boshek/master * Swap an if-else * These functions have moved * Use `done()` instead of `message()` * Add expectations for file or dir in the project * Finish adjusting to new behaviour or write_over() and use_template()