
"Hey I'd like to remove these untracked files I created to test stuff!"
Source:R/exo-clean-dir.R
exo_clean_dir.RdIf debugging for instance created now useless untracked files and directories,
there's no need to remove them "manually".
The tool for that is git clean:
git clean -nfor a dry run;git clean -fto run it; Add-dto also remove directories. See https://git-scm.com/docs/git-clean.
Workflow
Running the function will create the exercise as a new folder in parent_path.
If called from RStudio or Positron, the function will open a new R session in
that IDE.
If not, the user will need to navigate to the path returned by the function,
and launch an R session from there.
The new R session will display messages about what challenge to solve,
and running the tip() function from that new R session will display
additional guiance.
Examples
if (FALSE) { # interactive()
parent_path <- withr::local_tempdir()
path <- exo_clean_dir(parent_path = parent_path)
}