Skip to content

Commit 5e62bf4

Browse files
refact: Return with non-zero-exit code on error
1 parent e899579 commit 5e62bf4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/CLI/Commands/UUID/Duplicates.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected static function check(CLI $cli, ModelWithContent $model, array &$uuids
3030
'uuid' => Uuid::generate()
3131
]);
3232
$model->uuid()->populate(true);
33-
$cli->print('✅ The duplicate UUID ' . $uuid . ' for ' . $model->id() . ' has been regenerated');
33+
$cli->out('✅ The duplicate UUID ' . $uuid . ' for ' . $model->id() . ' has been regenerated');
3434
} else {
3535
$cli->error('The UUID ' . $uuid . ' for ' . $model->id() . ' exists (' . $uuids[$uuid] . ')');
3636
}
@@ -84,7 +84,8 @@ public static function command(CLI $cli): void
8484
} elseif ($fix === true) {
8585
$cli->success(count($duplicates) . ' duplicates have been fixed');
8686
} else {
87-
$cli->print(count($duplicates) . ' duplicates! You can fix them with kirby uuid:duplicates --fix');
87+
$cli->out(count($duplicates) . ' duplicates! You can fix them with kirby uuid:duplicates --fix');
88+
exit(1);
8889
}
8990
}
9091
}

0 commit comments

Comments
 (0)