-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-deps.sh
executable file
·36 lines (28 loc) · 1.25 KB
/
update-deps.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
#!/usr/bin/env bash
SCRIPTDIR="$(cd "`dirname "$0"`"; pwd)"
TIMESTAMP="$(date +%Y%m%d_%H%M%S)"
LOGDIR="${SCRIPTDIR}/.logs"
[[ -d "${LOGDIR}" ]] || mkdir -p "${LOGDIR}"
UNAME="$(uname)"
CMD="$(basename "$0")"
# NOTE: set USE_HTTPS if no ssh connectivity
#USE_HTTPS=1
if [[ -n "${USE_HTTPS}" ]]; then
UPDATE_OPT="--clone"
NINJA_URL="https://github.com/ninja-build/ninja.git"
else
UPDATE_OPT="--clone-with-ssh"
NINJA_URL="[email protected]:ninja-build/ninja.git"
fi
# NOTE: swift should be updated manually because it may include local changes
UPDATE_OPT="${UPDATE_OPT} --skip-repository swift"
echo "Updating dependencies started at $(date)" | tee -a "${LOGDIR}/${CMD}-${TIMESTAMP}.log"
${SCRIPTDIR}/../swift/utils/update-checkout ${UPDATE_OPT} 2>&1 | tee -a "${LOGDIR}/${CMD}-${TIMESTAMP}.log"
if [[ "${UNAME}" == "Darwin" ]]; then
pushd ${SCRIPTDIR}/.. > /dev/null
echo "--- Updating '$(pwd)/ninja' ---" | tee -a "${LOGDIR}/${CMD}-${TIMESTAMP}.log"
[[ -d "ninja" ]] || git clone ${NINJA_URL} 2>&1 | tee -a "${LOGDIR}/${CMD}-${TIMESTAMP}.log"
(cd ninja; git checkout release 2>&1 | tee -a "${LOGDIR}/${CMD}-${TIMESTAMP}.log")
popd > /dev/null
fi
echo "Updating dependencies finished at $(date)" | tee -a "${LOGDIR}/${CMD}-${TIMESTAMP}.log"