Skip to content

Commit

Permalink
tiny tweaks to update (#584)
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli authored Jan 10, 2025
1 parent 6b69d52 commit 7e4d783
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions compiler/update.jou
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7e4d783

Please sign in to comment.