Skip to content

Instantly share code, notes, and snippets.

@fuxu
Created August 30, 2018 15:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fuxu/5a2a6e77aed9de845df1d790aa9cb1af to your computer and use it in GitHub Desktop.
Save fuxu/5a2a6e77aed9de845df1d790aa9cb1af to your computer and use it in GitHub Desktop.
analyze status of `istio.github.io` Chinese translate
#!/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