diff options
| author | 2012-12-12 20:15:50 -0300 | |
|---|---|---|
| committer | 2012-12-12 20:15:50 -0300 | |
| commit | 540e6aa6fcd86a98e270715d1d4e49493eacc270 (patch) | |
| tree | ad1b1fcca82d9638f5edcf7a4d9149ca113ba2d2 /nikola/plugins/command_build.py | |
| parent | 25744f4bf462020e353c503db3ec558604c19137 (diff) | |
| parent | 0f2c04e70a0ffdd0892d6970cafbcd952d221db5 (diff) | |
Merge tag 'upstream/5'
Upstream version 5
Diffstat (limited to 'nikola/plugins/command_build.py')
| -rw-r--r-- | nikola/plugins/command_build.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/nikola/plugins/command_build.py b/nikola/plugins/command_build.py new file mode 100644 index 0000000..cface15 --- /dev/null +++ b/nikola/plugins/command_build.py @@ -0,0 +1,32 @@ +import os +import tempfile + +from nikola.plugin_categories import Command + + +class CommandBuild(Command): + """Build the site.""" + + name = "build" + + def run(self, *args): + """Build the site using doit.""" + + # FIXME: this is crap, do it right + with tempfile.NamedTemporaryFile(suffix='.py', delete=False) as dodo: + dodo.write(''' +from doit.reporter import ExecutedOnlyReporter +DOIT_CONFIG = { + 'reporter': ExecutedOnlyReporter, + 'default_tasks': ['render_site'], +} +from nikola import Nikola +import conf +SITE = Nikola(**conf.__dict__) + + +def task_render_site(): + return SITE.gen_tasks() + ''') + dodo.flush() + os.system('doit -f %s -d . %s' % (dodo.name, ' '.join(args))) |
