-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
[gen_l10n] Throw error when arb file does not exist #107583
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -943,6 +943,12 @@ class LocalizationsGenerator { | |
static File templateArbFileFromFileName(String templateArbFileName, Directory inputDirectory) { | ||
final File templateArbFile = inputDirectory.childFile(templateArbFileName); | ||
final String templateArbFileStatModeString = templateArbFile.statSync().modeString(); | ||
final bool templateArbFileExists = templateArbFile.existsSync(); | ||
if (!templateArbFileExists) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could just be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I was looking at the diffs not at the overall context. The version of the code you had originally, that just relied on one stat call made sense as it was. Sorry about the (my) confusion. |
||
throw L10nException( | ||
"The 'template-arb-file', $templateArbFile, does not exist." | ||
); | ||
} | ||
if (templateArbFileStatModeString[0] == '-' && templateArbFileStatModeString[3] == '-') { | ||
throw L10nException( | ||
"The 'template-arb-file', $templateArbFile, is not readable.\n" | ||
|
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.
This variable isn't used
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.
It's used in line 952 to check the permissions of the file, I think. I can put it right before that if-block if it makes it clearer.
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.
It's all good, my mistake. See below.