helpers: Disallow removing the default profile with bash-it profile rm

pull/1865/head
Noah Gorny 2021-09-28 16:20:02 +03:00
parent 1ae407150c
commit e1017513d0
1 changed files with 6 additions and 0 deletions

View File

@ -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"