2019-03-16 22:08:33 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
cd $(dirname "${BASH_SOURCE[0]}")/..
|
|
|
|
|
2019-03-16 22:54:29 +00:00
|
|
|
cutter_timestamp=$(git show -s --format=%ct)
|
|
|
|
cutter_commit="$(git show -s --format="%H %s")"
|
|
|
|
|
2019-03-16 22:08:33 +00:00
|
|
|
echo "Cloning current cutter.re"
|
|
|
|
|
2019-03-16 22:54:29 +00:00
|
|
|
git clone --depth 1 git@github.com:radareorg/cutter.re.git || exit 1
|
2019-03-16 22:08:33 +00:00
|
|
|
|
|
|
|
echo "Updating docs"
|
|
|
|
|
|
|
|
rm -rf cutter.re/docs
|
2019-07-30 16:20:57 +00:00
|
|
|
rm -rf cutter.re/_site/docs
|
|
|
|
cp -a docs/build/html cutter.re/_site/docs || exit 1
|
2019-03-16 22:08:33 +00:00
|
|
|
|
|
|
|
echo "Committing new changes"
|
|
|
|
|
|
|
|
cd cutter.re || exit 1
|
2019-03-16 22:54:29 +00:00
|
|
|
docs_timestamp=$(git show -s --format=%ct)
|
|
|
|
if [ $docs_timestamp -ge $cutter_timestamp ]; then
|
|
|
|
echo "Last commit on cutter.re is newer than this commit on cutter. Skipping."
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2019-03-16 22:08:33 +00:00
|
|
|
git add . || exit 1
|
|
|
|
git diff --cached --quiet && echo "No changes." && exit 0
|
2019-03-16 22:54:29 +00:00
|
|
|
printf "Update docs from radareorg/cutter\n\nOriginal Commit:\n$cutter_commit" | git commit -F -
|
2019-03-16 22:08:33 +00:00
|
|
|
git push origin master || exit 1
|
|
|
|
|