#!/usr/bin/env bash

COURSES_DIR="user/pages"
BACKUP="${COURSES_DIR}.$(date +%F_%R)"

# make sure we're at project root
cd "$(dirname "$(realpath "$0")")";
cd ..

echo -e "Creating backup of pages in ${BACKUP}"
mv ${COURSES_DIR} ${BACKUP}

#COURSES_DIR="user/pages/03.courses"
#
#rm ${COURSES_DIR}

# shallow? (perhaps we should use a submodule anyways)
#git clone ssh://git@m3p2.ljbac.com:10022/m3p2/courses.git ${COURSES_DIR}

git submodule update --init --recursive
git submodule foreach git pull origin master
