Skip to content

Commit abb1db1

Browse files
committed
fix: handle missing command directory gracefully
The program now exits with success (code 0) when no commands are found, instead of returning an error. This fixes the integration test test_missing_directory which expects graceful handling of missing directories.
1 parent 9b33d0b commit abb1db1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ fn main() -> Result<()> {
164164
}
165165
}
166166

167+
// Check if we have any commands to work with
168+
if commands_vec.is_empty() {
169+
eprintln!("No command snippets found in: {}", config_dir.display());
170+
return Ok(());
171+
}
172+
167173
// Dispatch based on subcommand
168174
match cli_args.action {
169175
Some(Action::Edit) => {

0 commit comments

Comments
 (0)