Skip to content
Snippets Groups Projects
Commit 3be80539 authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

add copy of gruntfile and fct of symlink

parent 1e1a72af
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ import click
import datetime
import os
from distutils.dir_util import copy_tree
from shutil import copyfile
@click.command()
@click.option('--date', default=datetime.datetime.today().strftime('%Y-%m-%d'), help='Date of the presentation - format: YYYY-MM-DD')
......@@ -46,18 +47,8 @@ def main(date, name):
os.chdir(fullPath)
# generate the symlink to the theme
if not os.path.islink('theme'):
os.symlink('../../theme', 'theme')
click.echo(' > Symlink to theme created.')
else:
click.echo(' > Symlink to theme already exists.')
# generate the symlink to the package.json file
if not os.path.islink('package.json'):
os.symlink('../../theme/package.json', 'package.json')
click.echo(' > Symlink to package.json created.')
else:
click.echo(' > Symlink to package.json already exists.')
createSymlink('../../theme', 'theme')
createSymlink('../../theme/package.json', 'package.json')
# copy the contents of the template folder
if not os.path.isfile(os.path.join(fullPath, 'slides', 'index.md')):
......@@ -67,6 +58,21 @@ def main(date, name):
click.echo(' > Slide deck already exists.')
# copy the Gruntfile
if not os.path.isfile(os.path.join(fullPath, 'Gruntfile.coffee')):
copyfile(os.path.join(rootDir, 'template', 'Gruntfile.coffee'), os.path.join(fullPath, 'Gruntfile.coffee'))
click.echo(' > Gruntfile copied.')
else:
click.echo(' > Gruntfile already exists.')
def createSymlink(src, dst):
if not os.path.islink(dst):
os.symlink(src, dst)
click.echo(' > Symlink to {0} created.' . format(dst))
else:
click.echo(' > Symlink to {0} already exists.' . format(dst))
def validateDate(input):
"""Validate a date string to fit the ISO format"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment