[R-pkg-devel] .gitkeep file to prevent folder from erasing when empty

Johannes Ranke jranke at uni-bremen.de
Mon Oct 3 08:13:55 CEST 2016


Hi,

You can include the .gitkeep file in .Rbuildignore. This will prevent it from 
being present in the package you test or submit, but git willl still see it 
and keep the directory.

Johannes

Am Montag, 3. Oktober 2016, 00:03:33 schrieb Luck Buttered:
> Hello everyone:
> 
> I am working on a vignette for a package that outputs reports for users. As
> part of the vignette, users can manually run eval=FALSE code that creates
> example reports. These example reports that they create can be saved to an
> output folder within extdata (extdata/OutputFolder).
> 
> When I submit to CRAN, I will be sure that OutputFolder is empty. However,
> whenever I make it empty, the entire folder disappears. To combat this
> problem, I have placed a .gitkeep file within the OutputFolder.
> 
> I *believe* the presence of the .gitkeep file works as intended (prevents
> the automatic removal of the OutputFolder when empty). However, upon
> running check(), I receive a note:
> 
> *checking for hidden files and directories ... NOTE*
> *Found the following hidden files and directories:*
> *  inst/extdata/OutputFiles/.gitkeep*
> *These were most likely included in error. See section ‘Package*
> *structure’ in the ‘Writing R Extensions’ manual.*
> 
> Does anyone have advice on how to effectively remove this note? Otherwise,
> does my rationale above seem like a reasonable purpose for keeping the note?
> 
> Thank you for helping me approach this!
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-package-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
-- 



More information about the R-package-devel mailing list