mirror of
https://github.com/YunoHost/apps.git
synced 2024-09-03 20:06:07 +02:00
[enh] try to automatically generate a PR when en.json has been updated from tartare
This commit is contained in:
parent
217c1cad76
commit
152c67cba0
1 changed files with 30 additions and 0 deletions
|
@ -1,5 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
install_hub() {
|
||||||
|
wget https://github.com/github/hub/releases/download/v2.3.0-pre9/hub-linux-amd64-2.3.0-pre9.tgz
|
||||||
|
tar xf hub-linux-amd64-2.3.0-pre9.tgz
|
||||||
|
hub-linux-amd64-2.3.0-pre9/bin/hub pull-request
|
||||||
|
}
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
if [ ! "$1" ]
|
if [ ! "$1" ]
|
||||||
|
@ -11,6 +17,7 @@ fi
|
||||||
before_official=$(sha256sum official.json)
|
before_official=$(sha256sum official.json)
|
||||||
before_community=$(sha256sum community.json)
|
before_community=$(sha256sum community.json)
|
||||||
before_dev=$(sha256sum dev.json)
|
before_dev=$(sha256sum dev.json)
|
||||||
|
before_pull_commit=$(git show HEAD | head -n 1)
|
||||||
|
|
||||||
git pull
|
git pull
|
||||||
|
|
||||||
|
@ -28,3 +35,26 @@ if [ "$before_dev" != "$(sha256sum dev.json)" ]
|
||||||
then
|
then
|
||||||
python ./list_builder.py -g $1 dev.json
|
python ./list_builder.py -g $1 dev.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$before_pull_commit" != "$(git show HEAD | head -n 1)" ]
|
||||||
|
then
|
||||||
|
python ./update_translations.py
|
||||||
|
if [ "$(git status -s| grep 'M locales/en.json')" ]
|
||||||
|
then
|
||||||
|
git add locales/en.json
|
||||||
|
git commit -m "[mod] update en.json with new translations"
|
||||||
|
git push yunohost-bot master
|
||||||
|
|
||||||
|
# uses hub/git-spindle from pypi
|
||||||
|
# to install:
|
||||||
|
# $ virtualenv ve
|
||||||
|
# $ ve/bin/pip install "hub==2.0"
|
||||||
|
|
||||||
|
if [ ! -e hub-linux-amd64-2.3.0-pre9/bin/hub ]
|
||||||
|
then
|
||||||
|
install_hub
|
||||||
|
fi
|
||||||
|
|
||||||
|
hub-linux-amd64-2.3.0-pre9/bin/hub pull-request -h master -m "Update locales/en.json"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue