added yarn cache clean to yarn install script
This commit is contained in:
38
yarn2.sh
38
yarn2.sh
@@ -3,9 +3,9 @@ dir=$(pwd)
|
|||||||
|
|
||||||
# shellcheck disable=SC2129
|
# shellcheck disable=SC2129
|
||||||
printf "\n"
|
printf "\n"
|
||||||
printf "|##########################################|"
|
printf "|##########################################|\n"
|
||||||
printf "| Write to gitignore |"
|
printf "| Write to gitignore |\n"
|
||||||
printf "|##########################################|"
|
printf "|##########################################|\n"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
printf "\n" >> "$dir/.gitignore"
|
printf "\n" >> "$dir/.gitignore"
|
||||||
printf "\n###Yarn 2" >> "$dir/.gitignore"
|
printf "\n###Yarn 2" >> "$dir/.gitignore"
|
||||||
@@ -16,32 +16,40 @@ printf "\n.pnp.*" >> "$dir/.gitignore"
|
|||||||
|
|
||||||
# removes node_modules
|
# removes node_modules
|
||||||
printf "\n"
|
printf "\n"
|
||||||
printf "|##########################################|"
|
printf "|##########################################|\n"
|
||||||
printf "| Delete node_modules |"
|
printf "| Delete node_modules |\n"
|
||||||
printf "|##########################################|"
|
printf "|##########################################|\n"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
rm -rf node_modules
|
rm -rf node_modules
|
||||||
|
|
||||||
# Upgrade Yarn to Berry (latest Yarn 2 version known to Yarn 1)
|
# Upgrade Yarn to Berry (latest Yarn 2 version known to Yarn 1)
|
||||||
printf "\n"
|
printf "\n"
|
||||||
printf "|##########################################|"
|
printf "|##########################################|\n"
|
||||||
printf "| Set version berry |"
|
printf "| Set version berry |\n"
|
||||||
printf "|##########################################|"
|
printf "|##########################################|\n"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
yarn set version berry
|
yarn set version berry
|
||||||
|
|
||||||
# (optional) Adds `yarn upgrade-interactive` command back
|
# (optional) Adds `yarn upgrade-interactive` command back
|
||||||
printf "\n"
|
printf "\n"
|
||||||
printf "|##########################################|"
|
printf "|##########################################|\n"
|
||||||
printf "| Add interactive-tools |"
|
printf "| Add interactive-tools |\n"
|
||||||
printf "|##########################################|"
|
printf "|##########################################|\n"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
yarn plugin import interactive-tools
|
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
|
# Re-installs project using Yarn 2. This will also update your yarn.lock file, but will NOT sneakily upgrade the dependencies
|
||||||
printf "\n"
|
printf "\n"
|
||||||
printf "|##########################################|"
|
printf "|##########################################|\n"
|
||||||
printf "| Yarn install |"
|
printf "| Yarn install |\n"
|
||||||
printf "|##########################################|"
|
printf "|##########################################|\n"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
yarn install
|
yarn install
|
Reference in New Issue
Block a user