updated yarn install script
This commit is contained in:
25
yarn2.sh
25
yarn2.sh
@@ -2,6 +2,11 @@
|
||||
dir=$(pwd)
|
||||
|
||||
# shellcheck disable=SC2129
|
||||
printf "\n"
|
||||
printf "|##########################################|"
|
||||
printf "| Write to gitignore |"
|
||||
printf "|##########################################|"
|
||||
printf "\n"
|
||||
printf "\n" >> "$dir/.gitignore"
|
||||
printf "\n###Yarn 2" >> "$dir/.gitignore"
|
||||
printf "\n.yarn/*" >> "$dir/.gitignore"
|
||||
@@ -10,13 +15,33 @@ printf "\n!.yarn/plugins" >> "$dir/.gitignore"
|
||||
printf "\n.pnp.*" >> "$dir/.gitignore"
|
||||
|
||||
# removes node_modules
|
||||
printf "\n"
|
||||
printf "|##########################################|"
|
||||
printf "| Delete node_modules |"
|
||||
printf "|##########################################|"
|
||||
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"
|
||||
yarn set version berry
|
||||
|
||||
# (optional) Adds `yarn upgrade-interactive` command back
|
||||
printf "\n"
|
||||
printf "|##########################################|"
|
||||
printf "| Add interactive-tools |"
|
||||
printf "|##########################################|"
|
||||
printf "\n"
|
||||
yarn plugin import interactive-tools
|
||||
|
||||
# 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"
|
||||
yarn install
|
Reference in New Issue
Block a user