From e1017513d065683a540fb91ea15bb8430dc53d81 Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Tue, 28 Sep 2021 16:20:02 +0300 Subject: [PATCH] helpers: Disallow removing the default profile with bash-it profile rm --- lib/helpers.bash | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/helpers.bash b/lib/helpers.bash index b5fa41a3..7772b4f9 100755 --- a/lib/helpers.bash +++ b/lib/helpers.bash @@ -581,6 +581,12 @@ _bash-it-profile-rm() { return 1 fi + # Users should not be allowed to delete the default profile + if [[ $name == "default" ]]; then + echo -e "\033[91mCan not remove the default profile...\033[m" + return 1 + fi + local profile_path="${BASH_IT}/profiles/$name.bash_it" if [[ ! -f "$profile_path" ]]; then echo -e "\033[91mCould not find profile \"$name\"...\033[m"