summaryrefslogtreecommitdiffstats
path: root/tiny/repos-update.sh
blob: 048fbc4d109efcfd6e1f79bea79738cd35b70b50 (plain)
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
#!/bin/bash

# run as kyle
if [[ $(id -u) -eq 0 ]]; then
  su - kyle
fi


declare -a REPODIRS=("repo" "repo gaming r" "repo r" "repo small projects")

for d in "${REPODIRS[@]}"; do
  cd "$d"
  for r in *; do
    echo -e "\e[00;32mUpdating ${r}\e[00m"
    cd "$r"
    if [[ -d ".git" ]]; then git pull; fi
    if [[ -d ".svn" ]]; then svn up; fi

    if [[ ! $? -eq 0 ]]; then echo 'failed to update repo: ${r}'; fi
    cd ../
  done
  cd ../
done

exit 0