framework/script/schematics.sh

27 lines
573 B
Bash
Raw Normal View History

2020-04-16 22:08:07 +03:00
#!/bin/sh
# Schematics are saved in a separate git repository.
# Only non-existing files are added to the repository.
set -x
2020-05-09 03:09:49 +03:00
folder=~/server/plugins/FastAsyncWorldEdit/schematics/
hostname=github.com
ssh-keygen -R $hostname
ssh-keyscan -H $hostname >> ~/.ssh/known_hosts
2020-04-21 16:20:18 +03:00
2020-04-16 22:08:07 +03:00
while true; do
2020-05-09 03:09:49 +03:00
if [ ! -d "$folder" ]; then
git clone --depth 1 git@$hostname:kaboomserver/schematics.git $folder
2020-05-09 03:09:49 +03:00
fi
cd $folder
if [ "$(git add $(git ls-files -o) -v)" ]; then
2020-04-16 22:08:07 +03:00
git -c user.name='kaboom' -c user.email='kaboom.pw' commit -m "Add new schematics"
git push
fi
sleep 1
done