Skip .git dir
This commit is contained in:
parent
0e14ef7f7c
commit
528737be80
1 changed files with 27 additions and 24 deletions
|
@ -5,11 +5,14 @@ from django.core.management.base import BaseCommand, CommandError
|
||||||
|
|
||||||
from settings import MARKDOWN_PATH, DEPLOY_PATH
|
from settings import MARKDOWN_PATH, DEPLOY_PATH
|
||||||
|
|
||||||
|
ignore_dir = '.git'
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
help = 'Parse markdown files in %s' % MARKDOWN_PATH
|
help = 'Parse markdown files in %s' % MARKDOWN_PATH
|
||||||
|
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
for root, dirs, files in os.walk(MARKDOWN_PATH):
|
for root, dirs, files in os.walk(MARKDOWN_PATH):
|
||||||
|
if ignore_dir not in root:
|
||||||
for file in files:
|
for file in files:
|
||||||
subdir = root.replace(MARKDOWN_PATH, "")
|
subdir = root.replace(MARKDOWN_PATH, "")
|
||||||
mdfile = '%s/%s' % (root, file)
|
mdfile = '%s/%s' % (root, file)
|
||||||
|
|
Loading…
Reference in a new issue