Meta: Add confirmation for toolchain rebuilds if there's one already
This commit is contained in:
parent
76f524c1d6
commit
40984d3355
Notes:
sideshowbarker
2024-07-17 07:13:19 +09:00
Author: https://github.com/networkException Commit: https://github.com/SerenityOS/serenity/commit/40984d3355 Pull-request: https://github.com/SerenityOS/serenity/pull/15212 Reviewed-by: https://github.com/trflynn89
1 changed files with 11 additions and 0 deletions
|
@ -311,6 +311,16 @@ ensure_toolchain() {
|
|||
|
||||
}
|
||||
|
||||
confirm_rebuild_if_toolchain_exists() {
|
||||
[ ! -d "$TOOLCHAIN_DIR" ] && return
|
||||
|
||||
read -rp "You already have a toolchain, are you sure you want to delete and rebuild one [y/N]? " input
|
||||
|
||||
if [[ "$input" != "y" && "$input" != "Y" ]]; then
|
||||
die "Aborted rebuild"
|
||||
fi
|
||||
}
|
||||
|
||||
delete_toolchain() {
|
||||
[ ! -d "$TOOLCHAIN_DIR" ] || rm -rf "$TOOLCHAIN_DIR"
|
||||
}
|
||||
|
@ -482,6 +492,7 @@ elif [ "$CMD" = "delete" ]; then
|
|||
elif [ "$CMD" = "rebuild-toolchain" ]; then
|
||||
cmd_with_target
|
||||
lagom_unsupported "The lagom target uses the host toolchain"
|
||||
confirm_rebuild_if_toolchain_exists
|
||||
delete_toolchain
|
||||
ensure_toolchain
|
||||
elif [ "$CMD" = "rebuild-world" ]; then
|
||||
|
|
Loading…
Add table
Reference in a new issue