Repository navigation
clean properly figures directory when multiple format - #1566
Merged
Merged
Conversation
* unlink does not support / at the end of a file path to remove it * assume you can delete whole files folder is figure dir is the only one existing. If not only remove figure dir with correct path without / at the end
yihui
approved these changes
Apr 12, 2019
yihui
left a comment
Collaborator
There was a problem hiding this comment.
Many thanks for the great help!!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a proposal to help fix the issue related in #1553, #1472, #1503
issues corrected:
unlinkdoes not support path ending with/(more preciselySys.globis used and does not support that).knitr::opts_chunk$get('fig.path')returns a path with/so it was not correctly removing the figure directoryfiles_dir_figwas empty (character(0)) so figure dir was deleted but not thefiles_diras it should if it was the only format used. An emptyfiles_dirwas still existingidentical()test was TRUE but we did not want to delete the all files dir.This fix
/for unlink fig directory to workfile_dirif there is only one format to cleanHoping it helps fixing those bugs.
This change is