upgrade function

Future<void> upgrade()

runs the upgrade command: fts upgrade

Implementation

Future<void> upgrade() async {
  if (which('flutter').found) {
    trace(green('Upgrading fts (global package) ...\n'));
    final result =
        'flutter pub global activate flutter_translation_sheet'.start(
      runInShell: true,
      progress: Progress(
        (e) => trace(yellow(e, bold: false)),
        stderr: printerr,
      ),
    );

    if (result.exitCode == 0) {
      trace(green('\nfts upgraded to the latest version'));
    }
    exit(1);
  }
}