ulyngs / oxforddown

Template for writing an Oxford University thesis in R Markdown; uses the OxThesis LaTeX template and was inspired by thesisdown.
https://ulyngs.github.io/oxforddown/
MIT License
221 stars 81 forks source link

Cleaning scripts inadvertently delete a chapter #22

Closed matthew-law closed 3 years ago

matthew-law commented 3 years ago

I have a chapter which was in a file named 03-methodology.Rmd, and every time I built the full pdf it would be deleted. Fortunately I had backups and could find and restore the file, but needless to say it's not ideal.

After some investigation I've realised that the cleaning scripts were inadvertently deleting it because it has 'log' in the filename (ie methodology), even though this isn't the file extension. I assume that it's some/all of the following lines from the Makefile:

clean:
    Rscript -e 'file.remove(list.files(pattern = "*.(log|mtc|maf|aux|bbl|blg|xml)"))'

clean-knits:
    Rscript -e 'file.remove(list.files(pattern = "*.(docx|html|pdf|log|maf|mtc|tex|toc|out|lof|lot|bcf|aux)"))'
    Rscript -e 'unlink(list.files(pattern = "*_(files|cache)"), recursive = TRUE)'

I've easily been able to get around this by renaming the file 03-methods.Rmd, but thought it worth noting should it be a problem for anyone else.

ulyngs commented 3 years ago

whooooopsie!!! That's a massive blunder of mine in the regex, thank you so much for catching this!!

I just fixed this in this commit