Fix: Handle init command before config loading
The init command was being processed after attempting to load config, causing it to fail when no config existed. Now init is handled first so users can create the initial configuration. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -31,6 +31,12 @@ async fn main() -> anyhow::Result<()> {
|
||||
|
||||
let cli = Cli::parse();
|
||||
|
||||
// Handle init command first (before config loading)
|
||||
if matches!(cli.command, Some(Commands::Init)) {
|
||||
cmd_init()?;
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
// Load or create configuration
|
||||
let config = load_config(cli.config.as_deref())?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user