Skip to content
Permalink
Browse files

Making sure that .dep file is always generated, and listing it as tar…

…get for render_posts plugin.
  • Loading branch information
felixfontein committed Oct 25, 2016
1 parent 0941466 commit 6470755e5fa03b62a7ee481f7869e21d5ab568b1
Showing with 5 additions and 8 deletions.
  1. +2 −1 nikola/plugins/task/posts.py
  2. +3 −7 nikola/post.py
@@ -84,12 +84,13 @@ def tl_ch():
k = p.split('####MAGIC####CONFIG:', 1)[-1]
deps_dict[k] = self.site.config.get(k)
dest = post.translated_base_path(lang)
dep_file = dest + '.dep'
file_dep = [p for p in post.fragment_deps(lang) if not p.startswith("####MAGIC####")]
task = {
'basename': self.name,
'name': dest,
'file_dep': file_dep,
'targets': [dest],
'targets': [dest, dep_file],
'actions': [(post.compile, (lang, )),
(update_deps, (post, lang, )),
],
@@ -464,13 +464,9 @@ def register_depfile(self, dep, dest=None, lang=None):
def write_depfile(dest, deps_list):
"""Write a depfile for a given language."""
deps_path = dest + '.dep'
if deps_list:
deps_list = [p for p in deps_list if p != dest] # Don't depend on yourself (#1671)
with io.open(deps_path, "w+", encoding="utf8") as deps_file:
deps_file.write('\n'.join(deps_list))
else:
if os.path.isfile(deps_path):
os.unlink(deps_path)
deps_list = [p for p in deps_list if p != dest] # Don't depend on yourself (#1671)
with io.open(deps_path, "w+", encoding="utf8") as deps_file:
deps_file.write('\n'.join(deps_list))

def _get_dependencies(self, deps_list):
deps = []

0 comments on commit 6470755

Please sign in to comment.
You can’t perform that action at this time.