[gen_l10n] Fix unintended breaking change introduced by output-dir option (#55909)

* Fix breaking change introduced by gen_l10n output-dir option
This commit is contained in:
Shi-Hao Hong
2020-04-28 16:25:59 -07:00
committed by GitHub
parent b744cce169
commit de4f052703
3 changed files with 27 additions and 3 deletions

View File

@@ -27,10 +27,10 @@ void main(List<String> arguments) {
);
parser.addOption(
'output-dir',
defaultsTo: path.join('lib', 'l10n'),
help: 'The directory where the generated localization classes will be written. '
'The app must import the file specified in the \'output-localization-file\' '
'option from this directory.'
'option from this directory. If unspecified, this defaults to the same '
'directory as the input directory specified in \'arb-dir\'.'
);
parser.addOption(
'template-arb-file',

View File

@@ -511,7 +511,7 @@ class LocalizationsGenerator {
bool useDeferredLoading = false,
}) {
setInputDirectory(inputPathString);
setOutputDirectory(outputPathString);
setOutputDirectory(outputPathString ?? inputPathString);
setTemplateArbFile(templateArbFileName);
setOutputFile(outputFileString);
setPreferredSupportedLocales(preferredSupportedLocaleString);