feat: create needed directories

This commit is contained in:
Price Hiller 2022-07-31 00:30:45 -05:00
parent 086073b8b0
commit e56f5de52f

View File

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