forked from yudai/cf-release
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update
executable file
·43 lines (39 loc) · 1.08 KB
/
update
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
#!/bin/bash
if [ "$1" == "--help" ]; then
echo "USAGE: $0"
echo " This command takes no arguments."
echo ""
echo "This script does a git submodule update on all submodules"
exit 0
fi
set -x
if [[ "$(git --version | grep 'version 1.7')x" != "x" ]]; then
git pull && git submodule foreach --recursive git submodule sync && git submodule update --init --recursive
else
git pull && git submodule sync --recursive && git submodule foreach --recursive git submodule sync && git submodule update --init --recursive
fi
set +x
echo
echo
echo welcome to...
echo " ___ "
echo " _ __|_ |"
echo " | |/ / __/ "
echo " |___/____/ "
echo
if [[ -d jobs/micro || -d src/cloud_controller ]]; then
echo "For v1, please change to the v1 branch."
echo
echo
echo Cleaning out old v1 files that were not removed from a previous "git pull"
echo "Press 'y' & 'y' to delete each unnecessary folder"
if [[ -d jobs/micro ]]; then
rm -ri jobs/micro
fi
for src in cloud_controller dea router stager vblob_src
do
if [[ -d src/$src ]]; then
rm -ri src/$src
fi
done
fi