From aac9bf69f61d7fe025d2fd7711254940e0ec28d3 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Tue, 24 Jun 2025 19:32:42 +0200 Subject: [PATCH] cli/create_db: return an erroneous exit on on error --- lib/cli/commands/create_db.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/cli/commands/create_db.dart b/lib/cli/commands/create_db.dart index 6f27d76..3e3d7a6 100644 --- a/lib/cli/commands/create_db.dart +++ b/lib/cli/commands/create_db.dart @@ -35,12 +35,19 @@ class CreateDb extends Command { readWrite: true, ); + bool failed = false; await seedData(db).then((_) { print("Database created successfully"); }).catchError((error) { print("Error creating database: $error"); + failed = true; }).whenComplete(() { db.close(); }); + if (failed) { + exit(1); + } else { + exit(0); + } } }