Skip to content

Commit

Permalink
feat: allow overriding name
Browse files Browse the repository at this point in the history
This allows the source's name to be overridden if the receipt had been
loaded from another name.
  • Loading branch information
mistydemeo committed Dec 17, 2024
1 parent e89129e commit 18bcd3e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions axoupdater/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,19 @@ impl AxoUpdater {
Ok(self)
}

/// Changes this updater's name to `app_name`, regardless of what it was
/// initialized as and regardless of what was read from the receipt.
pub fn set_name(&mut self, app_name: &str) -> &mut AxoUpdater {
self.name = Some(app_name.to_owned());
if let Some(source) = &self.source {
let mut our_source = source.clone();
our_source.app_name = app_name.to_owned();
self.source = Some(our_source);
}

self
}

/// Enables printing the underlying installer's stdout.
pub fn enable_installer_stdout(&mut self) -> &mut AxoUpdater {
self.print_installer_stdout = true;
Expand Down

0 comments on commit 18bcd3e

Please sign in to comment.