Permalink
Browse files

don't fail if there are no assets

  • Loading branch information...
1 parent 12395a4 commit 2b01a7a939da274f76e807932b9e9c7225dd0f64 @ralsina committed Dec 28, 2012
Showing with 11 additions and 1 deletion.
  1. +1 −0 CHANGES.txt
  2. +10 −1 nikola/plugins/task_copy_assets.py
View
@@ -28,6 +28,7 @@ Bugfixes
* Wordpress importer: fixed issue 190, convert embedded H1 tags into H2
* Fixed bad interaction with Yapsy 1.10
* More elegant handling of "nikola init"
+* Don't crash if there's no assets to copy
New in v5
=========
@@ -45,7 +45,7 @@ def gen_tasks(self):
"output_folder": self.site.config['OUTPUT_FOLDER'],
"filters": self.site.config['FILTERS'],
}
-
+ flag = True
tasks = {}
for theme_name in kw['themes']:
src = os.path.join(utils.get_theme_path(theme_name), 'assets')
@@ -56,4 +56,13 @@ def gen_tasks(self):
tasks[task['name']] = task
task['uptodate'] = [utils.config_changed(kw)]
task['basename'] = self.name
+ flag = False
yield utils.apply_filters(task, kw['filters'])
+
+ if flag:
+ yield {
+ 'basename': self.name,
+ 'name': 'None',
+ 'uptodate': [True],
+ 'actions': [],
+ }

0 comments on commit 2b01a7a

Please sign in to comment.