forked from ncriss/t-vault
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclean_tvault.sh
66 lines (50 loc) · 1.47 KB
/
clean_tvault.sh
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
BASEDIR="$( cd "$(dirname "$0")" ; pwd -P )"
DOCKER_FILE_DIR=$BASEDIR/dist/src/main/docker
if [ -d "out_bin/" ]; then
echo "Removing out/bin ..."
rm -rf out_bin/
fi
if [ -d "tvault_final/" ]; then
echo "Removing tvault_final/ ..."
rm -rf tvault_final/
fi
if [ -f "tvault_all.tar.gz" ]; then
echo "Removing tvault_all.tar.gz ..."
rm -f tvault_all.tar.gz
fi
cd $DOCKER_FILE_DIR
if [ -f "tvault_all.tar.gz" ]; then
echo "Removing tvault_all.tar.gz from dockerfile ..."
rm -f tvault_all.tar.gz
fi
cd $BASEDIR
echo "Cleaning up API"
cd $BASEDIR/tvaultapi
mvn clean
cd $BASEDIR
mvn help:evaluate -Dexpression=settings.localRepository | grep -i ".m2" #to download the depedency to evaluate,otherwise fails
sleep 1m
REP_LOC=$(mvn help:evaluate -Dexpression=settings.localRepository | grep -i ".m2")
cd -- "$REP_LOC"
echo "Repositories available are:"
ls
cd ..
echo "Removing REPOSITORY FROM $REP_LOC ..."
rm -rf repository/
cd $BASEDIR
# cd ~/.m2/
# echo "Removing .m2/repository/ ..."
# rm -rf repository/
# cd $BASEDIR
echo "Cleaning up UI"
UI_DIR=$BASEDIR/tvaultuiv2
cd $UI_DIR
echo "Clean up existing node_modules directory..."
echo "Removing $UI_DIR/node_modules/ ..."
rm -rf node_modules
rm -rf build
echo "Completed removing the existing node_modules and build directory..."
cd $BASEDIR
echo "-----------------------------------------------------"
echo "Completed Successfully"
echo "-----------------------------------------------------"