Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions rust/lon/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ struct UpdateArgs {
/// Whether to commit lon.{nix,lock}.
#[arg(short, long, default_value_t = false)]
commit: bool,
/// Whether to continue to try to update sources
/// when a source fails to update.
#[arg(short, long, default_value_t = false)]
continue_on_error: bool,
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

picked this name rather arbitrarily, open to better suggestions

}

#[derive(Args)]
Expand Down Expand Up @@ -392,9 +396,19 @@ fn update(directory: impl AsRef<Path>, args: &UpdateArgs) -> Result<()> {

log::info!("Updating {name}...");

let summary = source
let summary = match source
.update()
.with_context(|| format!("Failed to update {name}"))?;
.with_context(|| format!("Failed to update {name}"))
{
Ok(summary) => summary,
Err(error) => {
if args.continue_on_error {
log::warn!("Skipping: {error}");
continue;
}
Err(error)?
}
};

if let Some(summary) = summary {
commit_message.add_summary(name, summary);
Expand Down