Skip to content

Commit 4fe485c

Browse files
Check if profiles exist when listing profiles
1 parent 3ca7367 commit 4fe485c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,12 @@ async fn actual_main(cli_app: Ferium) -> Result<()> {
313313
ProfileSubCommands::Delete { profile_name } => {
314314
subcommands::profile::delete(&mut config, profile_name)?;
315315
},
316-
ProfileSubCommands::List => subcommands::profile::list(&config),
316+
ProfileSubCommands::List => {
317+
if config.profiles.is_empty() {
318+
bail!("There are no profiles configured, create a profile using `ferium profile create`")
319+
}
320+
subcommands::profile::list(&config);
321+
},
317322
ProfileSubCommands::Switch { profile_name } => {
318323
subcommands::profile::switch(&mut config, profile_name)?;
319324
},

0 commit comments

Comments
 (0)