forked from mrsone40/vets-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreset-environment.sh
More file actions
executable file
·46 lines (44 loc) · 1.19 KB
/
reset-environment.sh
File metadata and controls
executable file
·46 lines (44 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
if ! [ -x "$(command -v yarn)" ]; then
echo "Installing yarn..."
npm i -g yarn@1.19.1
if [ $? -eq 0 ]; then
echo "Yarn successfulling installed globally."
else
echo "Yarn failed to install...please install manually."
exit 1
fi
else
yarn_version=$(yarn --version)
if [ "$yarn_version" != "1.19.1" ]; then
echo "Install yarn version 1.19.1 [y/N]: "
read input
case "$input" in
y|Y|yes|Yes)
npm i -g yarn@1.19.1
;;
*)
;;
esac
fi
fi
echo "Removing Babel cache..."
rm -rf ./.babelcache
if [ $? -eq 0 ]; then
echo "Successfully cleaned out .babelcache."
else
echo "Please manually remove your .babelcache folder."
fi
echo "Removing the node modules folder..."
rm -rf ./node_modules
if [ $? -eq 0 ]; then
echo "Successfully cleaned out the node modules folder."
yarn install
if [ $? -eq 0 ]; then
echo "yarn install successfully completed."
else
echo "Please manually re-run yarn install from the command line."
fi
else
echo "Please manually check your ./node_modules folder for issues."
fi