-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
misc(i18n): add assertion script #5686
Conversation
0e8701c
to
5e3c7b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other than the thing, this is good
colorText "✅ PASS. All strings have been collected." "$green" | ||
else | ||
colorText "❌ FAIL. Strings have changed." "$red" | ||
echo "Commit the changes to `lighthouse-core/lib/locales/` update the strings." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in bash, backticks evaluate. ;)
so this actually triggers this error: assert-strings-collected.sh: line 48: lighthouse-core/lib/locales/: Is a directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha, whoops! that'll show me to make aesthetic changes after running :)
function teardown { rm -f "$currentstringsPath" "$freshstringsPath"; } | ||
trap teardown EXIT | ||
|
||
cp $collectedstringsPath $currentstringsPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually wanna throw quotes around these paths? shellcheck prefers it like that in case there are spaces in my project path. (hint: there aren't)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ya, done
adds an assertion script to make sure we keep the strings up to date