Skip to content

Commit 6644b33

Browse files
committed
fix: make -O flag overwrite source file in-place
1 parent 02af227 commit 6644b33

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ fn run(cli: Cli) -> Result<(), Error> {
8585
updater = updater.output_dir(&output_dir);
8686
}
8787

88+
if cli.overwrite {
89+
updater = updater.overwrite(true);
90+
}
91+
8892
if cli.describe {
8993
let source_path = updater.source_path();
9094
let source_size = updater.source_size();
@@ -120,10 +124,6 @@ fn run(cli: Cli) -> Result<(), Error> {
120124
);
121125
println!();
122126

123-
if cli.overwrite {
124-
updater = updater.overwrite(true);
125-
}
126-
127127
if updater.check_for_update()? {
128128
println!("Performing delta update...");
129129
let (new_path, stats) = updater.perform_update()?;

src/updater.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ impl Updater {
101101
}
102102

103103
fn resolve_output_path(&self, control: &ControlFile) -> Result<PathBuf> {
104+
if self.overwrite {
105+
return Ok(self.appimage.path().to_path_buf());
106+
}
104107
let filename = control
105108
.filename
106109
.as_ref()

0 commit comments

Comments
 (0)