Fix format strings I could've sworn this worked Signed-off-by: Anirudh <icyph0x@pm.me>
Anirudh icyph0x@pm.me
Mon, 17 Jun 2019 16:46:24 +0530
1 files changed,
9 insertions(+),
6 deletions(-)
jump to
M
vite/vite.py
→
vite/vite.py
@@ -66,11 +66,14 @@ if os.path.exists(os.path.join(PAGES_PATH, head, tail)):
print(bad('Error: specified path exists.')) else: with open(os.path.join(PAGES_PATH, head, tail), 'w') as f: - f.write(f"""--- -template: -title: -date: {today} ----\n""") + to_write = ( + """--- + template + title:" + date: {today}" + ---\n""" + ).format(today) + f.write(to_write) print(good('Created %s.') % (os.path.join(PAGES_PATH, head, tail)))@@ -193,7 +196,7 @@ handler = http.server.SimpleHTTPRequestHandler
os.chdir(os.path.join(os.getcwd(), BUILD_PATH)) try: with socketserver.TCPServer(('', PORT), handler) as httpd: - print(run(f'Serving the {italic(cyan("build"))} directory at {yellow(f"http://localhost:{PORT}")}')) + print(run('Serving the {italic} directory at {yellow}'.format(italic(cyan("build"), yellow("http://localhost:{PORT}"))))) print(white('Ctrl+C') + ' to stop.') httpd.serve_forever() except KeyboardInterrupt: