refactored for one-repos use and updated readme
This commit is contained in:
+14
-24
@@ -7,36 +7,26 @@
|
||||
# @Last modified time: 21-04-2017
|
||||
# @License: GPL-V3
|
||||
|
||||
# setup
|
||||
distantrepos='https://figureslibres.io/gogs/bachir/TDSM-commissaires.git'
|
||||
|
||||
echo "Sync books"
|
||||
# script
|
||||
echo "Sync book"
|
||||
|
||||
# activate credential cache
|
||||
git config --global credential.helper cache
|
||||
git config --global credential.helper 'cache --timeout=7200'
|
||||
|
||||
folder='book-src'
|
||||
host='https://figureslibres.io/gogs/bachir'
|
||||
|
||||
# echo "$host"
|
||||
|
||||
repos[0]='TDSM-oeuvres'
|
||||
repos[1]='TDSM-notices'
|
||||
repos[2]='TDSM-commissaires'
|
||||
repos[3]='TDSM-english'
|
||||
|
||||
# echo $repos
|
||||
|
||||
for repo in "${repos[@]}"
|
||||
do
|
||||
echo ${repo}
|
||||
if [ -d $folder/$repo.git ];
|
||||
then
|
||||
# if repos exists, pull
|
||||
echo "Pull $repo"
|
||||
git -C $folder/$repo.git pull origin master
|
||||
else
|
||||
# if repos does not exists, clone
|
||||
echo "clone $repo"
|
||||
git clone $host/$repo.git $folder/$repo.git
|
||||
fi
|
||||
done
|
||||
if [ -d $folder/.git ];
|
||||
then
|
||||
# if repos exists, pull
|
||||
echo "Pull $repo"
|
||||
git -C $folder pull origin master
|
||||
else
|
||||
# if repos does not exists, clone
|
||||
echo "clone $repo"
|
||||
git clone $distantrepos $folder
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user