-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.sh
29 lines (25 loc) · 771 Bytes
/
update.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
#!/usr/bin/env bash
echo "Updating environment...."
git fetch && git pull origin master && echo ""
# Make sure src directory exists.
mkdir -p src
# Clone git repos.
for repo in \
Automattic/vip-go-mu-plugins \
Automattic/vip-go-skeleton \
tollmanz/wordpress-pecl-memcached-object-cache
do
# Clone repo if it is not in the "src" subfolder.
if [ ! -d "src/${repo##*/}/.git" ]; then
echo "Cloning $repo in the \"src\" subfolder...."
rm -rf src/${repo##*/}
git clone --recursive https://github.com/$repo src/${repo##*/}
fi
# Make sure repos are up-to-date.
echo "Updating ${repo##*/}...."
pushd src/${repo##*/} >/dev/null && \
git pull origin master --ff-only && \
git submodule update && \
popd >/dev/null && \
echo ""
done