mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 12:57:36 +00:00
Meta: Add confirmation for toolchain rebuilds if there's one already
This commit is contained in:
parent
76f524c1d6
commit
40984d3355
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() {
|
delete_toolchain() {
|
||||||
[ ! -d "$TOOLCHAIN_DIR" ] || rm -rf "$TOOLCHAIN_DIR"
|
[ ! -d "$TOOLCHAIN_DIR" ] || rm -rf "$TOOLCHAIN_DIR"
|
||||||
}
|
}
|
||||||
|
@ -482,6 +492,7 @@ elif [ "$CMD" = "delete" ]; then
|
||||||
elif [ "$CMD" = "rebuild-toolchain" ]; then
|
elif [ "$CMD" = "rebuild-toolchain" ]; then
|
||||||
cmd_with_target
|
cmd_with_target
|
||||||
lagom_unsupported "The lagom target uses the host toolchain"
|
lagom_unsupported "The lagom target uses the host toolchain"
|
||||||
|
confirm_rebuild_if_toolchain_exists
|
||||||
delete_toolchain
|
delete_toolchain
|
||||||
ensure_toolchain
|
ensure_toolchain
|
||||||
elif [ "$CMD" = "rebuild-world" ]; then
|
elif [ "$CMD" = "rebuild-world" ]; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue