From 7e4d783aee2389671273fa2b78eb638b4f4af8a4 Mon Sep 17 00:00:00 2001 From: Akuli Date: Fri, 10 Jan 2025 16:54:41 +0200 Subject: [PATCH] tiny tweaks to update (#584) --- compiler/update.jou | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/update.jou b/compiler/update.jou index b1f95a49..03bc730a 100644 --- a/compiler/update.jou +++ b/compiler/update.jou @@ -18,25 +18,26 @@ else: declare chdir(path: byte*) -> int -def fail_update() -> None: +def fail_update() -> noreturn: puts("") puts("Updating Jou failed. If you need help, please create an issue on GitHub:") puts(" https://github.com/Akuli/jou/issues/new") exit(1) + def confirm(prompt: byte*) -> None: printf("%s (y/n) ", prompt) fflush(stdout) - line: byte[50] + line: byte[50] = "" fgets(line, sizeof(line) as int, stdin) trim_ascii_whitespace(line) - yes = strcmp(line, "Y") == 0 or strcmp(line, "y") == 0 - if not yes: + if strcmp(line, "Y") != 0 and strcmp(line, "y") != 0: printf("Aborted.\n") exit(1) + def update_jou_compiler() -> None: exe = find_current_executable() exedir = dirname(exe)