Dont remove the output folder if it's the source one ;)

This commit is contained in:
Alexis Metaireau 2010-11-20 00:54:33 +00:00
commit 9a51102f29
2 changed files with 4 additions and 2 deletions

View file

@ -1,7 +1,6 @@
#!/usr/bin/env python
import argparse
from pelican.utils import clean_output_dir
from pelican.generators import Generator
from pelican.processors import (ArticlesProcessor, PagesProcessor,
StaticProcessor, PdfProcessor)
@ -30,7 +29,6 @@ if __name__ == '__main__':
generator = Generator(args.settings, args.path, args.theme,
args.output, markup)
clean_output_dir(generator.output_path)
processors = [ArticlesProcessor, PagesProcessor, StaticProcessor]
if generator.settings['PDF_PROCESSOR']:

View file

@ -7,6 +7,7 @@ from jinja2.exceptions import TemplateNotFound
from feedgenerator import Atom1Feed
from pelican.settings import read_settings
from pelican.utils import clean_output_dir
_TEMPLATES = ('index', 'tag', 'tags', 'article', 'category', 'categories',
'archives', 'page')
@ -52,6 +53,9 @@ class Generator(object):
if hasattr(p, 'preprocess'):
p.preprocess(context, self)
if self.output_path not in os.path.realpath(self.path):
clean_output_dir(self.output_path)
for p in processors:
p.process(context, self)