Created
August 30, 2018 15:03
-
-
Save fuxu/5a2a6e77aed9de845df1d790aa9cb1af to your computer and use it in GitHub Desktop.
analyze status of `istio.github.io` Chinese translate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Run in root path of repo `istio.github.io` | |
for ORIG in $(find content -type f ! -name "*.png" ! -name "*.svg"); do | |
CHINESE=content_zh/${ORIG#content/} | |
if [ ! -f $CHINESE ]; then | |
echo "\033[31m[MISSING]\033[0m: $CHINESE" | |
else | |
CHINESE_COMMIT=$(git log -n 1 --pretty=format:%H $CHINESE) | |
ORIGIN_COMMIT=$(git log -n 1 --pretty=format:%H $ORIG) | |
DIFF=$(git diff ${CHINESE_COMMIT}..${ORIGIN_COMMIT} -- ${ORIG}) | |
if [ "${#DIFF}" -eq "0" ]; then | |
echo "\033[32m[DONE]\033[0m: $CHINESE" | |
else | |
echo "\033[33m[UPDATED]\033[0m: $CHINESE" | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment