feat: clean up build dir each time
Anirudh icyph0x@pm.me
Mon, 18 Jun 2018 11:56:27 +0530
1 files changed,
8 insertions(+),
1 deletions(-)
jump to
M
vite/vite.py
→
vite/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'))