Skip to content

Commit

Permalink
feat(symlinks, configure): update direnv configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
trystan2k committed May 15, 2022
1 parent e51c69a commit 7a9adea
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
21 changes: 20 additions & 1 deletion configure/asdf-plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ plugins=(
java:adoptopenjdk-14.0.2+12:true
yarn:1.22.15:true
ruby:2.7.1:true
direnv:2.28.0:true
direnv:2.31.0:true
)

# ---------------------------------------------
Expand All @@ -39,6 +39,22 @@ preInstall() {
esac
}

postInstall() {

case $1 in
direnv)
info "Executing post-install step for $1"

# Configure direnv
asdf direnv setup --shell zsh --version "$2"

success "Post-install step for $1 completed"
;;
*)
;;
esac
}

install() {
info "Installing ASDF Plugins"

Expand Down Expand Up @@ -75,6 +91,9 @@ install() {
success "Version $PLUGIN_VERSION set as global for $PLUGIN_NAME"
fi

# Post install step
postInstall "$PLUGIN_NAME" "$PLUGIN_VERSION"

success "ASDF Plugin $PLUGIN_NAME version $PLUGIN_VERSION installed."
done
}
Expand Down
2 changes: 0 additions & 2 deletions configure/direnvrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env bash

# File: ~/.config/direnv/direnvrc
#shellcheck source=/dev/null
source "$(asdf direnv hook asdf)"

# Uncomment the following line to make direnv silent by default.
export DIRENV_LOG_FORMAT=""
4 changes: 3 additions & 1 deletion symlinks/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,10 @@ direnv() { asdf exec direnv "$@"; }

eval "$(mcfly init zsh)"

source "${XDG_CONFIG_HOME:-$HOME/.config}/asdf-direnv/zshrc"

# Maybe this shoudl be necessary if it does not auto load in IDEs, for example
#asdf exec direnv reload

# PERF: Uncoment these line and first one to get a performance report of terminal init
#zprof
#zprof

0 comments on commit 7a9adea

Please sign in to comment.