diff options
Diffstat (limited to 'scripts/nikola')
| -rwxr-xr-x | scripts/nikola | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/nikola b/scripts/nikola new file mode 100755 index 0000000..4b895d2 --- /dev/null +++ b/scripts/nikola @@ -0,0 +1,35 @@ +#!/usr/bin/env python + +"""Nikola main script.""" + +import os +import shutil +import sys + +import nikola + +USAGE = """To create a new site in a folder, run "nikola init foldername [src]". + +The destination folder must not exist. + +If you pass the src argument, that folder will be used as a template for +the new site instead of Nikola's sample site. +""" + + +def init(dst): + """Create a copy of demosite in the current folder.""" + if len(sys.argv) > 3: + src = sys.argv[3] + else: + src = os.path.join(os.path.dirname(nikola.__file__),'data','samplesite') + shutil.copytree(src, dst) + print "A new site with some sample data has been created at %s." % dst + print "See README.txt in that folder for more information." + +if __name__ == "__main__": + if len(sys.argv)>=3 and sys.argv[1] == "init": + print "Doing init" + init(sys.argv[2]) + else: + print USAGE |
