Bump self-update (#369)
This commit is contained in:
committed by
GitHub
parent
754402cfac
commit
6cddd57850
2169
Cargo.lock
generated
2169
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -21,10 +21,8 @@ structopt = "0.3.0"
|
|||||||
log = "0.4.6"
|
log = "0.4.6"
|
||||||
walkdir = "2.2.7"
|
walkdir = "2.2.7"
|
||||||
console = "0.9.0"
|
console = "0.9.0"
|
||||||
self_update_crate = { version = "0.8.0", optional = true, package = "self_update" }
|
|
||||||
lazy_static = "1.3.0"
|
lazy_static = "1.3.0"
|
||||||
chrono = "0.4.6"
|
chrono = "0.4.6"
|
||||||
openssl-probe = { version = "0.1.2", optional = true }
|
|
||||||
pretty_env_logger = "0.4.0"
|
pretty_env_logger = "0.4.0"
|
||||||
glob = "0.3.0"
|
glob = "0.3.0"
|
||||||
strum = { version = "0.17.1", features = ["derive"] }
|
strum = { version = "0.17.1", features = ["derive"] }
|
||||||
@@ -38,6 +36,10 @@ notify-rust = "3.6.3"
|
|||||||
|
|
||||||
[target.'cfg(unix)'.dependencies]
|
[target.'cfg(unix)'.dependencies]
|
||||||
nix = "0.17.0"
|
nix = "0.17.0"
|
||||||
|
self_update_crate = { version = "0.14.0", optional = true, package = "self_update", features = ["archive-tar", "compression-flate2", "rustls"] }
|
||||||
|
|
||||||
|
[target.'cfg(windows)'.dependencies]
|
||||||
|
self_update_crate = { version = "0.14.0", optional = true, package = "self_update", features = ["archive-zip", "compression-zip-deflate", "rustls"] }
|
||||||
|
|
||||||
[target.'cfg(target_os = "linux")'.dependencies]
|
[target.'cfg(target_os = "linux")'.dependencies]
|
||||||
rust-ini = "0.15.0"
|
rust-ini = "0.15.0"
|
||||||
@@ -48,4 +50,4 @@ lto = true
|
|||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
|
||||||
self-update = ["self_update_crate", "openssl-probe"]
|
self-update = ["self_update_crate"]
|
||||||
|
|||||||
@@ -72,7 +72,6 @@ fn run() -> Result<()> {
|
|||||||
|
|
||||||
#[cfg(feature = "self-update")]
|
#[cfg(feature = "self-update")]
|
||||||
{
|
{
|
||||||
openssl_probe::init_ssl_cert_env_vars();
|
|
||||||
if !run_type.dry() && env::var("TOPGRADE_NO_SELF_UPGRADE").is_err() {
|
if !run_type.dry() && env::var("TOPGRADE_NO_SELF_UPGRADE").is_err() {
|
||||||
let result = self_update::self_update();
|
let result = self_update::self_update();
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ use super::terminal::*;
|
|||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
use crate::error::Upgraded;
|
use crate::error::Upgraded;
|
||||||
use anyhow::{bail, Result};
|
use anyhow::{bail, Result};
|
||||||
use self_update_crate::backends::github::{GitHubUpdateStatus, Update};
|
use self_update_crate::backends::github::Update;
|
||||||
|
use self_update_crate::update::UpdateStatus;
|
||||||
use std::env;
|
use std::env;
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
use std::os::unix::process::CommandExt;
|
use std::os::unix::process::CommandExt;
|
||||||
@@ -22,12 +23,14 @@ pub fn self_update() -> Result<()> {
|
|||||||
.show_download_progress(true)
|
.show_download_progress(true)
|
||||||
.current_version(self_update_crate::cargo_crate_version!())
|
.current_version(self_update_crate::cargo_crate_version!())
|
||||||
.no_confirm(true)
|
.no_confirm(true)
|
||||||
.build()
|
.build()?
|
||||||
.and_then(Update::update_extended)?;
|
.update_extended()?;
|
||||||
|
|
||||||
if let GitHubUpdateStatus::Updated(release) = &result {
|
if let UpdateStatus::Updated(release) = &result {
|
||||||
println!("\nTopgrade upgraded to {}:\n", release.version());
|
println!("\nTopgrade upgraded to {}:\n", release.version);
|
||||||
println!("{}", release.body);
|
if let Some(body) = &release.body {
|
||||||
|
println!("{}", body);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
println!("Topgrade is up-to-date");
|
println!("Topgrade is up-to-date");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user