Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- TAG="UPDTR"
- BRANCH=$(git symbolic-ref -q --short HEAD)
- # Prints horizontal link for all terminal width.
- function mess() {
- echo "*** $1"
- printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' '*'
- }
- mess "Export translation .po files on stage"
- drush @stage.all language-export-translations fr sites/all/translations --y --replace
- mess "Copy updated .po files from stage to local instance"
- scp -r telerama@stage.telerama.adyax.net:../../var/www/stage/current/docroot/sites/all/translations/* sites/all/translations
- mess "Check changes of translations"
- CHANGED=$(echo $(git diff-index --name-status --exit-code HEAD | grep ".fr.po"))
- if [ -n "${CHANGED}" ]; then
- mess "Commit changes in branch $BRANCH"
- git add ../sites/all/translations/\*.po
- git commit -m "[$TAG] update translations from stage instance"
- git push origin $BRANCH
- else
- mess "No changes found"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement