Skip to content

Commit

Permalink
Check if profiles exist when listing profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
theRookieCoder authored Jul 18, 2022
1 parent 3ca7367 commit 4fe485c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,12 @@ async fn actual_main(cli_app: Ferium) -> Result<()> {
ProfileSubCommands::Delete { profile_name } => {
subcommands::profile::delete(&mut config, profile_name)?;
},
ProfileSubCommands::List => subcommands::profile::list(&config),
ProfileSubCommands::List => {
if config.profiles.is_empty() {
bail!("There are no profiles configured, create a profile using `ferium profile create`")
}
subcommands::profile::list(&config);
},
ProfileSubCommands::Switch { profile_name } => {
subcommands::profile::switch(&mut config, profile_name)?;
},
Expand Down

0 comments on commit 4fe485c

Please sign in to comment.