first draft
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Sync books"
|
||||
|
||||
# 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 ];
|
||||
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
|
||||
Reference in New Issue
Block a user