Make schematic script safer

This commit is contained in:
mathiascode 2020-05-09 03:09:49 +03:00
parent 1a8f8bfbc6
commit 5ba79b4831

View file

@ -6,11 +6,14 @@
set -x
ssh-keyscan github.com >> .ssh/known_hosts
folder=~/server/plugins/FastAsyncWorldEdit/schematics/
while true; do
git clone git@github.com:kaboomserver/schematics.git ~/server/plugins/FastAsyncWorldEdit/schematics/
cd ~/server/plugins/FastAsyncWorldEdit/schematics/
if [ "$(git add $(git ls-files -o) -v)" ]; then
if [ ! -d "$folder" ]; then
git clone --depth 1 git@github.com:kaboomserver/schematics.git $folder
fi
if [ "$(cd $folder && git add $(git ls-files -o) -v)" ]; then
git -c user.name='kaboom' -c user.email='kaboom.pw' commit -m "Add new schematics"
git push
fi