import 'dart:async'; import 'dart:io'; import 'package:oto_cli/cli/cli.dart'; import 'package:oto_cli/cli/commands/command_base.dart'; import 'package:dart_framework/utils/system_util.dart'; import 'package:oto_cli/oto/application.dart'; class CommandExe extends CommandBase { @override Map> get arguments => { '-j': ["Used when it's a Jenkins build."], '-f {file path}': ["Run the yaml file to process."], '-t': ["This is the setup for testing."] }; @override String get name => 'exe'; @override Future execute(List parameters) { for (var item in parameters) { if (item == '-j') { startJenkinsBuild(parameters.contains('-t')); break; } if (item.startsWith('-f ')) { startYaml(item.replaceFirst('-f ', '')); break; } } return simpleFuture; } void startJenkinsBuild(bool isTest) { Application.instance.build(isTest); } void startYaml(String target) { var file = File(target); if (file.existsSync()) { } else { print( CLI.style('There are no files in path "$target"', color: Color.red)); } } @override String getDescription() { return ':::: Read documents written in yaml to do process task.'; } }