From 337e188d2591239695f35720cda1f9057c57c85d Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Tue, 28 Sep 2021 16:12:19 +0300 Subject: [PATCH] helpers: Add bash-it profile rm --- lib/helpers.bash | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/helpers.bash b/lib/helpers.bash index 686d782d..9006cc14 100755 --- a/lib/helpers.bash +++ b/lib/helpers.bash @@ -571,6 +571,24 @@ _bash-it-profile-list() { echo "${profile/.bash_it/}" done } + +_bash-it-profile-rm() { + about 'Removes a profile from the "profiles" directory' + _group 'lib' + local name="$1" + if [[ -z $name ]]; then + echo -e "\033[91mPlease specify profile name to remove...\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" + return 1 + fi + + command rm "$profile_path" + echo "Removed profile \"$name\" successfully!" } _bash-it-profile-load() {