From 3a75c3eee6e6824bb0082ca6b1a3de10c25a1a48 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 11 Jun 2023 11:47:48 +0100 Subject: [PATCH] Adds helper function to install yarn --- config/zsh/aliases/node-js.zsh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/zsh/aliases/node-js.zsh b/config/zsh/aliases/node-js.zsh index dd176f4..efd54e2 100644 --- a/config/zsh/aliases/node-js.zsh +++ b/config/zsh/aliases/node-js.zsh @@ -144,6 +144,16 @@ install_nvm () { nvm install v16.16.0 } +# Helper function to install Yarn +install_yarn () { + if hash 'yarn' 2> /dev/null; then + echo -e "\033[0;33mYarn already installed, skipping...\033[0m" + else + echo -e "\033[0;33mInstalling Yarn...\033[0m" + npm install --global yarn + fi +} + # NVM commands alias nvmi='nvm install' alias nvmu='nvm use'