exec method
Run command.
The contents of katana.yaml
and the arguments of the command are passed to context
.
コマンドを実行します。
context
にkatana.yaml
の内容やコマンドの引数が渡されます。
Implementation
@override
Future<void> exec(ExecContext context) async {
final bin = context.yaml.getAsMap("bin");
final flutter = bin.get("flutter", "flutter");
final melos = bin.get("melos", "melos");
if (File("melos.yaml").existsSync()) {
await command(
"Get import packages for all packages.",
[
melos,
"exec",
"--",
"$flutter pub get",
],
);
} else {
await command(
"Get the project package.",
[
flutter,
"pub",
"get",
],
);
}
}