Swap asdf with mise

This commit is contained in:
Kevin Cotugno 2024-07-19 07:21:54 -07:00
parent 4b8128a3af
commit 2693cdc545
2 changed files with 11 additions and 35 deletions

10
.zshrc
View File

@ -1,3 +1,5 @@
mkdir -p "$HOME/.local/bin" && export PATH="$HOME/.local/bin:$PATH"
oh_my_zsh="$HOME/.oh-my-zsh" oh_my_zsh="$HOME/.oh-my-zsh"
if [[ -f "$oh_my_zsh/oh-my-zsh.sh" ]]; then if [[ -f "$oh_my_zsh/oh-my-zsh.sh" ]]; then
@ -13,7 +15,6 @@ if [[ -f "$oh_my_zsh/oh-my-zsh.sh" ]]; then
git git
isodate isodate
urltools urltools
asdf
) )
if [[ $(command -v tmux) ]]; then if [[ $(command -v tmux) ]]; then
@ -24,6 +25,11 @@ if [[ -f "$oh_my_zsh/oh-my-zsh.sh" ]]; then
plugins+=(tmux) plugins+=(tmux)
fi fi
if [[ $(command -v mise) ]]; then
plugins+=(mise)
eval "$(mise activate zsh)"
fi
if [[ $(command -v fzf) ]]; then plugins+=(fzf); fi if [[ $(command -v fzf) ]]; then plugins+=(fzf); fi
if [[ $(command -v systemctl) ]]; then if [[ $(command -v systemctl) ]]; then
@ -70,8 +76,6 @@ if [[ $(command -v fzf) && $(command -v fd) ]]; then
export FZF_DEFAULT_COMMAND="fd --type f --hidden --no-ignore --follow --exclude .git" export FZF_DEFAULT_COMMAND="fd --type f --hidden --no-ignore --follow --exclude .git"
fi fi
mkdir -p "$HOME/.local/bin" && export PATH="$HOME/.local/bin:$PATH"
function weather() { function weather() {
local loc=$1 local loc=$1
if [[ -z "$loc" ]]; then if [[ -z "$loc" ]]; then

View File

@ -92,36 +92,9 @@ function install_oh_my_zsh() {
git -C "$HOME" clone https://code.cotugno.family/kevin/ohmyzsh.git "$(basename "$oh_my_zsh_dir")" git -C "$HOME" clone https://code.cotugno.family/kevin/ohmyzsh.git "$(basename "$oh_my_zsh_dir")"
} }
function install_asdf() { function install_mise() {
local asdf_dir="$HOME/.asdf" curl https://mise.run | sh
if [ -d "$asdf_dir" ]; then mise install
echo "asdf is already installed"
return
fi
echo "Installing asdf..."
if [ "$OS" = "darwin" ]; then
$install_package_cmd asdf
. "/usr/local/opt/asdf/libexec/asdf.sh"
else
git -C "$HOME" clone https://code.cotugno.family/kevin/asdf.git "$(basename "$asdf_dir")"
git -C "$asdf_dir" checkout "$(git -C "$asdf_dir" describe --tags --abbrev=0)"
. "$asdf_dir/asdf.sh"
fi
}
function setup_asdf() {
local asdf_plugins=(ruby nodejs)
for plugin in ${asdf_plugins[@]}; do
if [[ ! -d "$HOME/.asdf/plugins/$plugin" ]]; then
echo "Installing asdf $plugin plugin"
asdf plugin add "$plugin"
asdf install "$plugin" latest
else
echo "asdf plugin $plugin already installed"
fi
done
} }
function install_files() { function install_files() {
@ -140,6 +113,5 @@ detect_os
detect_package_manager detect_package_manager
install_git install_git
install_oh_my_zsh install_oh_my_zsh
install_asdf install_mise
setup_asdf
install_files install_files