Skip to content

Commit

Permalink
Fix deploy option issue
Browse files Browse the repository at this point in the history
  • Loading branch information
yanganto committed Nov 2, 2021
1 parent b481f04 commit 7453900
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions cargo-sewup/src/main.rs
Expand Up @@ -68,26 +68,29 @@ async fn main() -> Result<()> {
if sub_command == "init"
|| (sub_command == "sewup" && opt.second_argument == Some("init".into()))
{
init::run(opt.mode.unwrap_or_default()).await
} else {
return init::run(opt.mode.unwrap_or_default()).await;
} else if sub_command != "sewup" && opt.second_argument.is_none() {
println!("Unknown sub command {:?}", sub_command);
Ok(())
return Ok(());
} else if sub_command == "sewup" && opt.second_argument.is_some() {
println!("Unknown sub command {:?}", opt.second_argument.unwrap());
return Ok(());
}
}

return if let Some(inspect_file) = opt.inspect_file {
inspect::run(inspect_file).await
} else if opt.generate_abi {
generate::run().await
} else {
return if let Some(inspect_file) = opt.inspect_file {
inspect::run(inspect_file).await
} else if opt.generate_abi {
generate::run().await
} else {
let contract_name = build::run(opt.debug).await?;

if !opt.build_only {
if opt.verbose {
println!("contract : {}", contract_name);
}
deploy::run(contract_name, opt.verbose, opt.debug).await?;
let contract_name = build::run(opt.debug).await?;

if !opt.build_only {
if opt.verbose {
println!("contract : {}", contract_name);
}
Ok(())
};
}
deploy::run(contract_name, opt.verbose, opt.debug).await?;
}
Ok(())
};
}

0 comments on commit 7453900

Please sign in to comment.