mirror of
https://codeberg.org/Cyborus/forgejo-cli.git
synced 2024-11-14 05:59:27 +01:00
update forgejo-api
This commit is contained in:
parent
bbe5536b4f
commit
b85b939376
4 changed files with 19 additions and 5 deletions
16
Cargo.lock
generated
16
Cargo.lock
generated
|
@ -103,6 +103,12 @@ version = "0.21.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9"
|
checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "base64ct"
|
||||||
|
version = "1.6.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitflags"
|
name = "bitflags"
|
||||||
version = "1.3.2"
|
version = "1.3.2"
|
||||||
|
@ -331,8 +337,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "forgejo-api"
|
name = "forgejo-api"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://codeberg.org/Cyborus/forgejo-api.git?rev=bfb341c3e6#bfb341c3e6917d58fe65822602cf3eb0b1d5071b"
|
source = "git+https://codeberg.org/Cyborus/forgejo-api.git?rev=cb192d8eef#cb192d8eefcd0d58b51c05a6e4ded1db22caadbb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"base64ct",
|
||||||
"bytes",
|
"bytes",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"serde",
|
"serde",
|
||||||
|
@ -342,6 +349,7 @@ dependencies = [
|
||||||
"time",
|
"time",
|
||||||
"tokio",
|
"tokio",
|
||||||
"url",
|
"url",
|
||||||
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1713,3 +1721,9 @@ dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"windows-sys 0.48.0",
|
"windows-sys 0.48.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "zeroize"
|
||||||
|
version = "1.7.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d"
|
||||||
|
|
|
@ -10,7 +10,7 @@ auth-git2 = "0.5.3"
|
||||||
clap = { version = "4.3.11", features = ["derive"] }
|
clap = { version = "4.3.11", features = ["derive"] }
|
||||||
directories = "5.0.1"
|
directories = "5.0.1"
|
||||||
eyre = "0.6.8"
|
eyre = "0.6.8"
|
||||||
forgejo-api = { git = "https://codeberg.org/Cyborus/forgejo-api.git", rev = "bfb341c3e6" }
|
forgejo-api = { git = "https://codeberg.org/Cyborus/forgejo-api.git", rev = "cb192d8eef" }
|
||||||
futures = "0.3.28"
|
futures = "0.3.28"
|
||||||
git2 = "0.17.2"
|
git2 = "0.17.2"
|
||||||
open = "5.0.0"
|
open = "5.0.0"
|
||||||
|
|
|
@ -80,6 +80,6 @@ impl LoginInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn api_for(&self, url: &Url) -> Result<forgejo_api::Forgejo, forgejo_api::ForgejoError> {
|
pub fn api_for(&self, url: &Url) -> Result<forgejo_api::Forgejo, forgejo_api::ForgejoError> {
|
||||||
forgejo_api::Forgejo::new(&self.key, url.clone())
|
forgejo_api::Forgejo::new(forgejo_api::Auth::Token(&self.key), url.clone())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -400,11 +400,11 @@ async fn download_asset(
|
||||||
let release = find_release(repo, api, &release).await?;
|
let release = find_release(repo, api, &release).await?;
|
||||||
let file = match &*asset {
|
let file = match &*asset {
|
||||||
"source.zip" => {
|
"source.zip" => {
|
||||||
api.download_release_zip(repo.owner(), repo.name(), release.id)
|
api.download_zip_archive(repo.owner(), repo.name(), &release.tag_name)
|
||||||
.await?
|
.await?
|
||||||
}
|
}
|
||||||
"source.tar.gz" => {
|
"source.tar.gz" => {
|
||||||
api.download_release_tarball(repo.owner(), repo.name(), release.id)
|
api.download_tarball_archive(repo.owner(), repo.name(), &release.tag_name)
|
||||||
.await?
|
.await?
|
||||||
}
|
}
|
||||||
name => {
|
name => {
|
||||||
|
|
Loading…
Reference in a new issue