Skip to content
This repository was archived by the owner on Oct 2, 2025. It is now read-only.

Commit 75f2551

Browse files
committed
fix oci download progress
1 parent 45de669 commit 75f2551

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "soar-dl"
3-
version = "0.3.0"
3+
version = "0.3.1"
44
authors = ["Rabindra Dhakal <[email protected]>"]
55
description = "A fast download manager"
66
license = "MIT"

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# soar-dl
2-
A lightning-fast, feature-rich release asset downloader for GitHub and GitLab repositories with support for direct downloads.
2+
3+
A lightning-fast, feature-rich release download manager with support for GitHub, GitLab and OCI package downloads
34

45
# Installation
6+
57
```sh
68
cargo install soar-dl -F binary
79
```
810

911
# Usage
12+
1013
## Examples
1114

1215
> [!note]
@@ -22,6 +25,11 @@ soar-dl --gitlab "inkscape/inkscape"
2225
# Download using gitlab project id
2326
soar-dl --github "18817634"
2427

28+
# Download ghcr image or blob
29+
# Note: when using ghcr image, the custom path is always treated as a directory
30+
soar-dl --ghcr "ghcr.io/pkgforge/pkgcache/86box/appimage/official/stable/86box:v4.2.1-x86_64-linux"
31+
soar-dl --ghcr "ghcr.io/pkgforge/pkgcache/86box/appimage/official/stable/86box@sha256:28e166a2253f058bfe380bd856cd056b3ca9d8544fc82193f017bb7fdc39b749"
32+
2533
# Direct download
2634
soar-dl "https://github.com/pkgforge/soar/releases/download/nightly/soar-nightly-x86_64-linux"
2735

@@ -38,6 +46,7 @@ soar-dl --github "pkgforge/soar" --gitlab "18817634" --output "final"
3846
```
3947

4048
## Command Line Options
49+
4150
```
4251
Usage: soar-dl [OPTIONS] [LINKS]...
4352
@@ -47,6 +56,7 @@ Arguments:
4756
Options:
4857
--github <GITHUB> Github project
4958
--gitlab <GITLAB> Gitlab project
59+
--ghcr <GHCR> GHCR image or blob
5060
-r, --regex <REGEX_PATTERNS> Regex to select the asset. Only works for github downloads
5161
-m, --match <MATCH_KEYWORDS> Check if the asset contains given string
5262
-e, --exclude <EXCLUDE_KEYWORDS> Check if the asset contains given string

src/bin/soar-dl/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub struct Args {
2121
#[arg(required = false, long)]
2222
pub gitlab: Vec<String>,
2323

24-
/// OCI reference
24+
/// GHCR image or blob
2525
#[arg(required = false, long)]
2626
pub ghcr: Vec<String>,
2727

src/downloader.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ impl Downloader {
157157
callback(DownloadState::Preparing(total_bytes));
158158
}
159159
let mut current = downloaded_bytes.lock().unwrap();
160-
*current = bytes;
160+
*current += bytes;
161161
callback(DownloadState::Progress(*current));
162162
}
163163
})
@@ -211,7 +211,7 @@ impl Downloader {
211211
.pull_layer(&layer, &file_path, move |bytes, _| {
212212
if let Some(ref callback) = cb_clone {
213213
let mut current = downloaded_bytes.lock().unwrap();
214-
*current = bytes;
214+
*current += bytes;
215215
callback(DownloadState::Progress(*current));
216216
}
217217
})

0 commit comments

Comments
 (0)