File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -11,4 +11,33 @@ mkdir -pv ~/.configure/wordpress-ios/secrets
1111cp -v fastlane/env/project.env-example ~ /.configure/wordpress-ios/secrets/project.env
1212
1313echo " --- Lint Localized Strings Format"
14- bundle exec fastlane generate_strings_file_for_glotpress skip_commit:true
14+ LOGS=logs.txt
15+ set +e
16+ set -o pipefail
17+ bundle exec fastlane generate_strings_file_for_glotpress skip_commit:true | tee $LOGS
18+ EXIT_CODE=$?
19+ set -e
20+
21+ echo $EXIT_CODE
22+
23+ if [[ $EXIT_CODE -ne 0 ]]; then
24+ # Strings generation finished with errors, extract the errors in an easy-to-find section
25+ echo " --- Report genstrings errors"
26+ ERRORS=errors.txt
27+ echo " Found errors when trying to run \` genstrings\` to generate the \` .strings\` files from \` *LocalizedStrings\` calls:" | tee $ERRORS
28+ echo ' ' >> $ERRORS
29+ # Print the errors inline.
30+ #
31+ # Notice the second `sed` call that removes the ANSI escape sequences that
32+ # Fastlane uses to color the output.
33+ grep -e " \[.*\].*genstrings:" $LOGS \
34+ | sed -e ' s/\[.*\].*genstrings: error: /- /' \
35+ | sed -e $' s/\x1b \[[0-9;]*m//g' \
36+ | sort \
37+ | uniq \
38+ | tee -a $ERRORS
39+ # Annotate the build with the errors
40+ cat $ERRORS | buildkite-agent annotate --style error --context genstrings
41+ fi
42+
43+ exit $EXIT_CODE
You can’t perform that action at this time.
0 commit comments