Skip to content

Commit

Permalink
fix: Skip if no package is available.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrunet committed Apr 18, 2024
1 parent a15c4ee commit d26a33c
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 29 deletions.
2 changes: 1 addition & 1 deletion packages/katana_cli/lib/action/firebase/deploy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class FirebaseDeployCliAction extends CliCommand with CliActionMixin {
label("Import firestore.indexes.json");
final firestoreIndexes = File("${firebaseDir.path}/firestore.indexes.json");
final indexData = await command(
"Import packages.",
"Import indexes.",
[
firebaseCommand,
"firestore:indexes",
Expand Down
2 changes: 1 addition & 1 deletion packages/katana_cli/lib/action/firebase/init.dart
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ class FirebaseInitCliAction extends CliCommand with CliActionMixin {
label("Import firestore.indexes.json");
final firestoreIndexes = File("firebase/firestore.indexes.json");
final indexData = await command(
"Import packages.",
"Import indexes.",
[
firebaseCommand,
"firestore:indexes",
Expand Down
2 changes: 1 addition & 1 deletion packages/katana_cli/lib/action/firebase/scheduler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class FirebaseSchedulerCliAction extends CliCommand with CliActionMixin {
label("Import firestore.indexes.json");
final firestoreIndexes = File("firebase/firestore.indexes.json");
final indexData = await command(
"Import packages.",
"Import indexes.",
[
firebaseCommand,
"firestore:indexes",
Expand Down
42 changes: 23 additions & 19 deletions packages/katana_cli/lib/src/framework.dart
Original file line number Diff line number Diff line change
Expand Up @@ -510,16 +510,18 @@ Future<void> addFlutterImport(
}
addPackages.add(package);
}
await command(
"Import packages.",
[
flutterCommand,
"pub",
"add",
"--dev",
...addPackages,
],
);
if (addPackages.isNotEmpty) {
await command(
"Import packages.",
[
flutterCommand,
"pub",
"add",
"--dev",
...addPackages,
],
);
}
} else {
final dependencies = pubspec.getAsMap("dependencies");
for (final package in packages) {
Expand All @@ -528,15 +530,17 @@ Future<void> addFlutterImport(
}
addPackages.add(package);
}
await command(
"Import packages.",
[
flutterCommand,
"pub",
"add",
...addPackages,
],
);
if (addPackages.isNotEmpty) {
await command(
"Import packages.",
[
flutterCommand,
"pub",
"add",
...addPackages,
],
);
}
}
}

Expand Down
14 changes: 7 additions & 7 deletions packages/katana_cli/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ packages:
dependency: "direct main"
description:
name: csv
sha256: "63ed2871dd6471193dffc52c0e6c76fb86269c00244d244297abbb355c84a86e"
sha256: c6aa2679b2a18cb57652920f674488d89712efaf4d3fdf2e537215b35fc19d6c
url: "https://pub.dev"
source: hosted
version: "5.1.1"
version: "6.0.0"
encrypt:
dependency: transitive
description:
Expand All @@ -101,10 +101,10 @@ packages:
dependency: "direct main"
description:
name: flutter_lints
sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7
sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
version: "3.0.2"
html:
dependency: "direct main"
description:
Expand Down Expand Up @@ -167,7 +167,7 @@ packages:
path: "../katana"
relative: true
source: path
version: "2.12.1"
version: "2.13.2"
lints:
dependency: transitive
description:
Expand Down Expand Up @@ -268,10 +268,10 @@ packages:
dependency: transitive
description:
name: uuid
sha256: cd210a09f7c18cbe5a02511718e0334de6559871052c90a90c0cca46a4aa81c8
sha256: "814e9e88f21a176ae1359149021870e87f7cddaf633ab678a5d2b0bff7fd1ba8"
url: "https://pub.dev"
source: hosted
version: "4.3.3"
version: "4.4.0"
web:
dependency: transitive
description:
Expand Down

0 comments on commit d26a33c

Please sign in to comment.