-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsubmodules.sh
executable file
·43 lines (39 loc) · 1.22 KB
/
submodules.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
#!/bin/bash
# Check if there are any submodules
if [[ $(git submodule--helper list) ]]; then
echo "Updating test folders"
cd test
if [[ $(git remote -vv) ]]; then
echo "Remote origin found..."
cd ..
else
cd ..
rm -rf ./test
git submodule add git@github.com:moneytrees/backendtesting.git test
fi
cd client/src/test
if [[ $(git remote -vv) ]]; then
echo "Remote origin for client found..."
cd ../../../
else
cd ../../../
rm -rf ./client/src/test
git submodule add git@github.com:moneytrees/frontendtesting.git client/src/test
fi
git submodule sync
git submodule update --init --recursive
git submodule foreach git pull origin develop
else
echo "Missing test folders...installing"
if [ -d './test' ]; then
rm -rf ./test
fi
git submodule add git@github.com:moneytrees/backendtesting.git test
if [ -d './client/src/test' ]; then
rm -rf ./client/src/test
fi
git submodule add git@github.com:moneytrees/frontendtesting.git client/src/test
git submodule sync
git submodule update --init --recursive
git submodule foreach git pull origin develop
fi