From fc1a58cae5eeac920369f692444f3e4eec043833 Mon Sep 17 00:00:00 2001 From: vikingowl Date: Mon, 7 Feb 2022 18:29:11 +0100 Subject: [PATCH] added yarn cache clean to yarn install script --- yarn2.sh | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/yarn2.sh b/yarn2.sh index def47a5..1166223 100755 --- a/yarn2.sh +++ b/yarn2.sh @@ -3,9 +3,9 @@ dir=$(pwd) # shellcheck disable=SC2129 printf "\n" -printf "|##########################################|" -printf "| Write to gitignore |" -printf "|##########################################|" +printf "|##########################################|\n" +printf "| Write to gitignore |\n" +printf "|##########################################|\n" printf "\n" printf "\n" >> "$dir/.gitignore" printf "\n###Yarn 2" >> "$dir/.gitignore" @@ -16,32 +16,40 @@ printf "\n.pnp.*" >> "$dir/.gitignore" # removes node_modules printf "\n" -printf "|##########################################|" -printf "| Delete node_modules |" -printf "|##########################################|" +printf "|##########################################|\n" +printf "| Delete node_modules |\n" +printf "|##########################################|\n" printf "\n" rm -rf node_modules # Upgrade Yarn to Berry (latest Yarn 2 version known to Yarn 1) printf "\n" -printf "|##########################################|" -printf "| Set version berry |" -printf "|##########################################|" +printf "|##########################################|\n" +printf "| Set version berry |\n" +printf "|##########################################|\n" printf "\n" yarn set version berry # (optional) Adds `yarn upgrade-interactive` command back printf "\n" -printf "|##########################################|" -printf "| Add interactive-tools |" -printf "|##########################################|" +printf "|##########################################|\n" +printf "| Add interactive-tools |\n" +printf "|##########################################|\n" printf "\n" yarn plugin import interactive-tools +# Cleans yarn cache +printf "\n" +printf "|##########################################|\n" +printf "| Cleans yarn cache |\n" +printf "|##########################################|\n" +printf "\n" +yarn cache clean + # Re-installs project using Yarn 2. This will also update your yarn.lock file, but will NOT sneakily upgrade the dependencies printf "\n" -printf "|##########################################|" -printf "| Yarn install |" -printf "|##########################################|" +printf "|##########################################|\n" +printf "| Yarn install |\n" +printf "|##########################################|\n" printf "\n" yarn install \ No newline at end of file