Merge pull request #4872 from blueyed/_ensure_supporting_files
cacheprovider: _ensure_supporting_files: remove unused branches
This commit is contained in:
commit
e1f97e41e3
|
@ -132,24 +132,21 @@ class Cache(object):
|
||||||
else:
|
else:
|
||||||
with f:
|
with f:
|
||||||
json.dump(value, f, indent=2, sort_keys=True)
|
json.dump(value, f, indent=2, sort_keys=True)
|
||||||
|
|
||||||
if not cache_dir_exists_already:
|
if not cache_dir_exists_already:
|
||||||
self._ensure_supporting_files()
|
self._ensure_supporting_files()
|
||||||
|
|
||||||
def _ensure_supporting_files(self):
|
def _ensure_supporting_files(self):
|
||||||
"""Create supporting files in the cache dir that are not really part of the cache."""
|
"""Create supporting files in the cache dir that are not really part of the cache."""
|
||||||
if self._cachedir.is_dir():
|
readme_path = self._cachedir / "README.md"
|
||||||
readme_path = self._cachedir / "README.md"
|
readme_path.write_text(README_CONTENT)
|
||||||
if not readme_path.is_file():
|
|
||||||
readme_path.write_text(README_CONTENT)
|
|
||||||
|
|
||||||
gitignore_path = self._cachedir.joinpath(".gitignore")
|
gitignore_path = self._cachedir.joinpath(".gitignore")
|
||||||
if not gitignore_path.is_file():
|
msg = u"# Created by pytest automatically.\n*"
|
||||||
msg = u"# Created by pytest automatically.\n*"
|
gitignore_path.write_text(msg, encoding="UTF-8")
|
||||||
gitignore_path.write_text(msg, encoding="UTF-8")
|
|
||||||
|
|
||||||
cachedir_tag_path = self._cachedir.joinpath("CACHEDIR.TAG")
|
cachedir_tag_path = self._cachedir.joinpath("CACHEDIR.TAG")
|
||||||
if not cachedir_tag_path.is_file():
|
cachedir_tag_path.write_bytes(CACHEDIR_TAG_CONTENT)
|
||||||
cachedir_tag_path.write_bytes(CACHEDIR_TAG_CONTENT)
|
|
||||||
|
|
||||||
|
|
||||||
class LFPlugin(object):
|
class LFPlugin(object):
|
||||||
|
|
Loading…
Reference in New Issue