add script to pull git repos
This commit is contained in:
parent
27742db4fb
commit
8e5b0ce928
|
@ -2,3 +2,6 @@
|
|||
.env
|
||||
# emacs
|
||||
*~
|
||||
|
||||
django-orchestra
|
||||
django-musician
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
set -u
|
||||
# DEBUG
|
||||
set -x
|
||||
|
||||
# clone or pull git repo
|
||||
_pull() {
|
||||
myurl="${1}"
|
||||
mydir="$(basename "${myurl}")"
|
||||
mybranch="${2}"
|
||||
|
||||
if [ -d "${mydir}" ]; then
|
||||
cd "${mydir}"
|
||||
git checkout "${mybranch}"
|
||||
git pull
|
||||
cd -
|
||||
else
|
||||
git clone "${myurl}" "${mydir}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
main() {
|
||||
_pull 'https://gitea.pangea.org/pangea/django-orchestra' 'sso'
|
||||
_pull 'https://gitea.pangea.org/pangea/django-musician' 'sso'
|
||||
}
|
||||
|
||||
main "${@}"
|
||||
|
Reference in New Issue