Yarn version manager for the Fish shell :fish: :heart:
Version manager for yarn written in & for Fish
$fish_user_paths
and doesn’t mess with anything else.
fisher add cideM/fish-yvm
yvm use latest
Install with Fisher (recommended):
fisher add cideM/fish-yvm
This assumes that you’re fish config folder is located under ~/.config/fish
for i in functions completions
curl https://raw.githubusercontent.com/cideM/fish-yvm/master/$i/yvm.fish --create-dirs -sLo $XDG_CONFIG_HOME/fish/$i/yvm.fish
end
use <version>
Installs and activates given version of yarn
. Version needs to exactly match one of the versions returned from yvm ls
, which will be suggested through tab completion. The only exception to this rule is that latest
will always install the most recent yarn
version. Takes an optional -f
or --force-fetch
flag, which forces fetching the list of available resources from remote. If not the list is only updated if it’s older than 120s.
List of releases is stored under $XDG_DATA_HOME/yvm_fish/yarn_releases
(for most people this will be ~/.local/share/yvm_fish/yarn_releases
.
The currently active version is stored under $XDG_DATA_HOME/yvm_fish/version
.
Example:
yvm use 1.19.0
ls
/list
Lists all available yarn
releases. Takes the same -f
flag as use
, with the same caching behavior. If you want to only see the installed versions, just pipe the output into something like grep
.
Examples:
yvm ls | grep installed
yvm ls | grep active
$ yvm ls | head -n 5
1.19.1 installed active
1.19.0 installed
1.18.0
1.17.3
1.17.2
rm <version>
Removes specified version from file system and PATH. Same version matching rules as for use
apply, including latest
.
Example:
yvm rm 1.19.0
help
Prints the help, just like yvm -h
and yvm --help
yvm ls | grep installed
yvm ls | grep active
yvm
yvm rm
$XDG_DATA_HOME/yvm_fish/
(most likely ~/.local/share/yvm_fish
, so rm -r ~/.local/share/yvm_fish
)$XDG_CONFIG_HOME/yvm-fish/
(most likely ~/.config/yvm-fish
, so rm -r ~/.config/yvm-fish
)fisher rm cideM/fish-yvm
This shows installing a very old version which doesn’t export yarn
, but rather kpm.js
. It also shows what happens when you try to install a version that doesn’t have a release tarball.