all repos — py-vite @ ca6d2e45c01a8921eff666412feb21e2ce8fc624

the original vite, written in python

feat: use shutil to copy make.py to project dir
icyphox icyph0x@protonmail.com
Fri, 16 Mar 2018 10:01:58 +0530
commit

ca6d2e45c01a8921eff666412feb21e2ce8fc624

parent

6b37adb6b9fdcc5dca82e438685298147d2e5142

1 files changed, 3 insertions(+), 1 deletions(-)

jump to
M vite.pyvite.py

@@ -6,6 +6,7 @@ import sys

import argparse import errno import pathlib +import shutil parser = argparse.ArgumentParser(description='A simple and mnml static site generator.') parser.add_argument('action', choices=['new'], help='Create a new project.')

@@ -23,12 +24,13 @@ try:

abs_path = pathlib.Path(path).resolve() pathlib.Path(path + '/pages').mkdir(parents=True, exist_ok=False) pathlib.Path(path + '/build').mkdir(exist_ok=False) - make_file(path) + cp_make(path) print('Created project directory at %s.' % (abs_path)) except FileExistsError as e: print('Error: specified path exists.') def cp_make(path): + shutil.copy('make.py', path) def main(): create_dirs(project_path)