mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-09 03:20:56 +00:00
simplify: inline rendered_config into execute
The helper was a 2-line indirection with a single caller. Inline its body so the whole command fits in one function. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b98513875a
commit
4a696e0706
1 changed files with 2 additions and 8 deletions
|
|
@ -23,10 +23,7 @@ struct RenderedConfig {
|
|||
server: ServerSettings,
|
||||
}
|
||||
|
||||
async fn rendered_config(
|
||||
args: &SettingsArgs,
|
||||
base_ctx: &CommandContext,
|
||||
) -> anyhow::Result<serde_json::Value> {
|
||||
pub(crate) async fn execute(args: &SettingsArgs, base_ctx: &CommandContext) -> anyhow::Result<()> {
|
||||
let ctx = base_ctx.with_target(&args.target)?;
|
||||
let user = fabro_config::UserSettings::resolve()?;
|
||||
let server = ctx
|
||||
|
|
@ -34,11 +31,8 @@ async fn rendered_config(
|
|||
.await?
|
||||
.retrieve_resolved_server_settings()
|
||||
.await?;
|
||||
serde_json::to_value(RenderedConfig { user, server }).map_err(Into::into)
|
||||
}
|
||||
let config = serde_json::to_value(RenderedConfig { user, server })?;
|
||||
|
||||
pub(crate) async fn execute(args: &SettingsArgs, base_ctx: &CommandContext) -> anyhow::Result<()> {
|
||||
let config = Box::pin(rendered_config(args, base_ctx)).await?;
|
||||
if base_ctx.json_output() {
|
||||
print_json_pretty(&config)?;
|
||||
return Ok(());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue