From b7df8a86162a540068b53fa671459f84ef0a723a Mon Sep 17 00:00:00 2001 From: maker2413 Date: Thu, 3 Oct 2024 00:27:57 -0500 Subject: [PATCH] fixed a bug that broke bootstrapping if a default profile was not already set --- CHANGELOG.org | 6 ++++++ yacm | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index 59b6530..18de66d 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -6,6 +6,12 @@ ** [Unreleased] +** [0.2.1] - 2024-10-3 + +*** Fixed + - A bug where bootstrapping was broken if a default profile was not already + set. + ** [0.2.0] - 2024-10-2 *** Added diff --git a/yacm b/yacm index e600d05..ab651c5 100755 --- a/yacm +++ b/yacm @@ -159,9 +159,15 @@ function bootstrap() { local subcommand=$1; if [[ -z $subcommand ]]; then echo "Checking current default profile..."; - if [[ -f $YACM_PROFILES_DIR/$default_profile.yml ]]; then + if [[ -f $YACM_DIR/default_profile ]]; then default_profile="$(cat "$YACM_DIR"/default_profile 2>/dev/null)"; - bootstrap_prompt "$default_profile"; + if [[ -f $YACM_PROFILES_DIR/$default_profile.yml ]]; then + bootstrap_prompt "$default_profile"; + else + echo -e "\n\e[31mSpecified default profile, \e[32m$default_profile\e[31m, doesn't exist!.\e[0m"; + echo -e "Please run: \e[32myacm profile default\e[0m to set default for this system or"; + echo -e "run: \e[32myacm bootstrap profile [profile_name]\e[0m to specify which profile to use."; + fi else echo -e "\n\e[31mNo default profile currently set!.\e[0m"; echo -e "Please run: \e[32myacm profile default\e[0m to set default for this system or";