Skip to content

Commit

Permalink
Merge pull request #288 from Workiva/INTL-1793
Browse files Browse the repository at this point in the history
INTL-1793 : Have over_react_codemod show deprecation message
  • Loading branch information
rmconsole5-wk authored Apr 25, 2024
2 parents 3d427d5 + e626446 commit 0c235dd
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion lib/src/executables/intl_message_migration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ final parser = ArgParser()
late ArgResults parsedArgs;

void main(List<String> args) async {
printDeprecationNotice();
parsedArgs = parser.parse(args);
if (parsedArgs['help'] as bool) {
printUsage();
Expand Down Expand Up @@ -154,6 +155,7 @@ void main(List<String> args) async {
args: codemodArgs,
additionalHelpOutput: parser.usage,
);

if (exitCode != 0) return;
logWarning('^ Ignore the "codemod found no files" warning above for now.');

Expand Down Expand Up @@ -210,14 +212,30 @@ void main(List<String> args) async {
}
}

void printDeprecationNotice() {
printInRed('***** Deprecation Notice *****');
printInBlue(
'# over_react_codemod:intl_message_migration is deprecated and will no longer receive updates.');
stderr.writeln('# Instead, use the dart_dev or intl_tools commands:');
stderr.writeln('# dart_dev intl <subcommands>');
stderr.writeln('# For example: '
'dart_dev intl {check|migrate|sort}');
stderr.writeln(
'# Refer to the documentation https://wiki.atl.workiva.net/display/FEF/Intl+Quick+Reference+Guide of dart_dev / dart_dev_workiva for more information on using intl_codemod with dart_dev.');
}

void printInBlue(String text) {
print(ansi.blue.wrap(text));
}

void printInRed(String text) {
print(ansi.red.wrap(text));
}

void printUsage() {
stderr.writeln(
'Migrates literal strings that seem user-visible in the package by wrapping them in Intl.message calls.');
stderr.writeln();

stderr.writeln('Usage:');
stderr.writeln(' intl_message_migration [arguments]');
stderr.writeln();
Expand Down

0 comments on commit 0c235dd

Please sign in to comment.