plugins: add option to toggle asdf

This commit is contained in:
lelgenio 2022-04-29 19:41:04 -03:00
parent ba91f1fe55
commit a9a28656b7
5 changed files with 39 additions and 23 deletions

View file

@ -23,6 +23,7 @@ variables:
bar_pos: top bar_pos: top
tmux: false tmux: false
starship: false starship: false
asdf: false
user_svdir: $HOME/.config/runit user_svdir: $HOME/.config/runit
accent_fg: '#ffffff' accent_fg: '#ffffff'

View file

@ -8,6 +8,9 @@
set -U fish_features stderr-nocaret qmark-noglob regex-easyesc set -U fish_features stderr-nocaret qmark-noglob regex-easyesc
if status is-interactive if status is-interactive
{%@@ if asdf @@%}
set asdf
{%@@ endif @@%}
source {$__fish_config_dir}/env.fish source {$__fish_config_dir}/env.fish
source {$__fish_config_dir}/wm.fish source {$__fish_config_dir}/wm.fish

View file

@ -17,11 +17,13 @@ set -x XDG_DATA_DIRS "$XDG_DATA_DIRS:$HOME/.local/share"
set -x XDG_CONFIG_HOME "$HOME/.config/" set -x XDG_CONFIG_HOME "$HOME/.config/"
set __cargo_asdf_bin ~/.asdf/installs/rust/*/bin/ if set -q asdf
set __yarn_asdf_bin ~/.config/yarn/global/node_modules/.bin/ set __cargo_asdf_bin ~/.asdf/installs/rust/*/bin/
set __yarn_asdf_bin ~/.config/yarn/global/node_modules/.bin/
end
for i in ~/.local/bin $__cargo_asdf_bin $__yarn_asdf_bin ~/.yarn/bin ~/.factorio/bin/* for i in ~/.local/bin $__cargo_asdf_bin $__yarn_asdf_bin ~/.yarn/bin ~/.factorio/bin/*
test -d "$i";and fish_add_path "$i" test -d "$i";and fish_add_path --global "$i"
end end
# needed for tmux # needed for tmux

View file

@ -8,7 +8,9 @@ if not functions -q fundle
and test "$USER" != root and test "$USER" != root
eval (curl -sfL https://git.io/fundle-install) eval (curl -sfL https://git.io/fundle-install)
end end
# fundle plugin 'FabioAntunes/fish-nvm' if not set -q asdf
fundle plugin 'FabioAntunes/fish-nvm'
end
fundle plugin 'edc/bass' fundle plugin 'edc/bass'
fundle init fundle init
@ -25,37 +27,42 @@ command -qs direnv &&
# asdf Version manager # asdf Version manager
################################################## ##################################################
if not test -d ~/.asdf if set -q asdf
and test "$USER" != root if not test -d ~/.asdf
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.9.0 and test "$USER" != root
mkdir -p ~/.config/fish/completions git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.9.0
and ln -s ~/.asdf/completions/asdf.fish ~/.config/fish/completions mkdir -p ~/.config/fish/completions
and ln -s ~/.asdf/completions/asdf.fish ~/.config/fish/completions
source ~/.asdf/asdf.fish source ~/.asdf/asdf.fish
asdf plugin add nodejs asdf plugin add nodejs
asdf install nodejs 12.13.1 asdf install nodejs 12.13.1
asdf install nodejs latest asdf install nodejs latest
asdf global nodejs latest asdf global nodejs latest
asdf plugin-add yarn asdf plugin-add yarn
asdf install yarn latest asdf install yarn latest
asdf global yarn latest asdf global yarn latest
asdf plugin add rust asdf plugin add rust
asdf install rust nightly asdf install rust nightly
asdf global rust nightly asdf global rust nightly
end
test -f ~/.asdf/asdf.fish
and source ~/.asdf/asdf.fish
end end
test -f ~/.asdf/asdf.fish
and source ~/.asdf/asdf.fish
################################################## ##################################################
# Rust tools # Rust tools
################################################## ##################################################
command -qs rustup
or _install-rustup &> /dev/null &
command -qs sccache command -qs sccache
or _install-sccache &> /dev/null & or _install-sccache &> /dev/null &
# set -x RUSTC_WRAPPER sccache # set -x RUSTC_WRAPPER sccache

View file

@ -0,0 +1,3 @@
#!/bin/sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh