all repos — py-vite @ f443eda7956fae135a8106485ab2e4c15a7d0cd6

the original vite, written in python

Fix post-build actions

Signed-off-by: Anirudh Oppiliappan <x@icyphox.sh>
Anirudh Oppiliappan x@icyphox.sh
Tue, 26 May 2020 19:00:51 +0530
commit

f443eda7956fae135a8106485ab2e4c15a7d0cd6

parent

d8caa0f8c1eecc30bcfdb93e0981645e5e8c2d86

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

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

@@ -1,5 +1,5 @@

# vite - a simple and minimal static site generator, that JustWorks™ -# Copyright (c) 2019 Anirudh Oppiliappan <x@icyphox.sh> +# Copyright (c) 2020 Anirudh Oppiliappan <x@icyphox.sh> # Licensed under the MIT license import sys

@@ -253,18 +253,18 @@

def builder(): path = os.getcwd() start = time.process_time() - try: - if config.pre_build != "": - print(run("Running pre-build actions...")) - for s in config.pre_build: - print(info(f"{s}")) - call([s]) - except AttributeError: - pass if not os.listdir(os.path.join(path, PAGES_PATH)): print(info(italic("pages") + " directory is empty. Nothing to build.")) sys.exit(1) else: + try: + if config.pre_build != "": + print(run("Running pre-build actions...")) + for s in config.pre_build: + print(info(f"{s}")) + call([s]) + except AttributeError: + pass clean() html_gen() if os.path.exists(os.path.join(os.getcwd(), "static")):