From e56f5de52ffb286abe1abbe92756dff6dafeb324 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Sun, 31 Jul 2022 00:30:45 -0500 Subject: [PATCH] feat: create needed directories --- install.bash | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/install.bash b/install.bash index 6327bd7..b250e73 100644 --- a/install.bash +++ b/install.bash @@ -178,6 +178,22 @@ install-pyenv() { ) || return 1 } +create-dirs() { + local dirs=( + "${HOME}/.local/bin" + "${HOME}/.local/share" + ) + ret_code=0 + for dir in "${dirs[@]}"; do + log "info" "Creating directory ${GREEN}${dir}${RESET_BOLD}" + if ! mkdir -p "${dir}"; then + log "error" "Failed to create directory: ${GREEN}${dir}${RESET_BOLD}" + ret_code=1 + fi + done + return "${ret_code}" +} + deploy-config() { local install_paths declare -A install_paths=( @@ -223,6 +239,14 @@ main() { log "info" "Script dependencies good" print-break + log "info" "Creating directories" + if ! create-dirs; then + log "error" "Unable to create required directories" + exit 1 + fi + log "info" "Finished creating directories" + print-break + log "info" "Installing ${GREEN}FZF${RESET_BOLD}" if ! install-fzf "${DEPS_PATH}"; then log "error" "Failed to install ${GREEN}FZF${RESET_BOLD}"