all repos — py-vite @ 357f92e07f80bf691b2bff36e19d4e1b63653477

the original vite, written in python

feat: clean up build dir each time
Anirudh icyph0x@pm.me
Mon, 18 Jun 2018 11:56:27 +0530
commit

357f92e07f80bf691b2bff36e19d4e1b63653477

parent

aec18eec50c4225282633f14a75c31aa45723c99

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

jump to
M vite/vite.pyvite/vite.py

@@ -14,8 +14,8 @@ import socketserver

import shutil from markdown2 import markdown_path -from huepy import * from distutils.dir_util import copy_tree +from huepy import * from vite import vite

@@ -140,6 +140,12 @@ print(info('Stopping server.'))

httpd.socket.close() sys.exit(1) + +def clean(): + shutil.rmtree(BUILD_PATH) + os.makedirs(BUILD_PATH) + + def builder(): path = os.getcwd() start = time.process_time()

@@ -148,6 +154,7 @@ print(info(italic('pages') + ' directory is empty. Nothing to build.'))

sys.exit(1) else: try: + clean() html_gen() if not os.path.exists(os.path.join(path, BUILD_PATH, 'static')): os.mkdir(os.path.join(path, BUILD_PATH, 'static'))