#!/bin/sh

git clone https://github.com/FriendsOfCake/crud.git web/api/app/Plugin/Crud
cd web/api/app/Plugin/Crud && git -c advice.detachedHead=false checkout 1429237
git submodule update --init --recursive
cd ../../../../..
git clone https://github.com/ZoneMinder/CakePHP-Enum-Behavior.git web/api/app/Plugin/CakePHP-Enum-Behavior
cd web/api/app/Plugin/CakePHP-Enum-Behavior && git -c advice.detachedHead=false checkout ea90c0c
cd ../../../../..
git clone https://github.com/ZoneMinder/RtspServer dep/RtspServer
cd dep/RtspServer && git -c advice.detachedHead=false checkout eab3285
cd ../..

rm -rf .git*
find -name .gitignore -delete
rm -rf web/api/app/Plugin/Crud/.*
rm -rf web/api/app/Plugin/CakePHP-Enum-Behavior/.*
rm -rf dep/RtspServer/.*
