Closed rsangole closed 6 years ago
You could perhaps, instead of writing a file from a function, create a new file in inst/defaults/
and call file.copy(system.file([...]))
. Perhaps call it inst/defaults/rstudio/rstudio.rproj
, and copy it using
file.copy(system.file(file.path('defaults', 'rstudio', 'rstudio.rproj')),
file.path(project.dir, paste0(project.name, '.rproj'))
The system.file
function prepends the path to the inst
directory of a given package. This allows you to retrieve a file from the installation directory. The file.copy
function can rename the file in one go to the project name.
@Hugovdberg lovely. That's the sort of path I wanted to adopt initially but wasn't sure if we have a 'space' where we're OK saving files like these.
Will send another commit later today.
@rsangole did I miss the new commit? is this ready to be reviewed and merged?
Temporarily closing — seems to be stale.
@rsangole if this is ready to commit please reopen the PR.
Types of change
Pull request checklist
man
Proposed changes