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
tmux: false
starship: false
asdf: false
user_svdir: $HOME/.config/runit
accent_fg: '#ffffff'

View File

@ -8,6 +8,9 @@
set -U fish_features stderr-nocaret qmark-noglob regex-easyesc
if status is-interactive
{%@@ if asdf @@%}
set asdf
{%@@ endif @@%}
source {$__fish_config_dir}/env.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 __cargo_asdf_bin ~/.asdf/installs/rust/*/bin/
set __yarn_asdf_bin ~/.config/yarn/global/node_modules/.bin/
if set -q asdf
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/*
test -d "$i";and fish_add_path "$i"
test -d "$i";and fish_add_path --global "$i"
end
# needed for tmux

View File

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

View File

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