Do not check for self upgrade if already upgraded
This commit is contained in:
@@ -73,7 +73,7 @@ fn run() -> Result<(), Error> {
|
|||||||
|
|
||||||
#[cfg(feature = "self-update")]
|
#[cfg(feature = "self-update")]
|
||||||
{
|
{
|
||||||
if !opt.dry_run {
|
if !opt.dry_run && !env::var("TOPGRADE_NO_SELF_UPGRADE").is_ok() {
|
||||||
if let Err(e) = self_update::self_update() {
|
if let Err(e) = self_update::self_update() {
|
||||||
print_warning(format!("Self update error: {}", e));
|
print_warning(format!("Self update error: {}", e));
|
||||||
if let Some(cause) = e.cause() {
|
if let Some(cause) = e.cause() {
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ pub fn self_update() -> Result<(), Error> {
|
|||||||
print_warning("Respawning...");
|
print_warning("Respawning...");
|
||||||
let err = Command::new(current_exe.context(ErrorKind::SelfUpdate)?)
|
let err = Command::new(current_exe.context(ErrorKind::SelfUpdate)?)
|
||||||
.args(env::args().skip(1))
|
.args(env::args().skip(1))
|
||||||
|
.env("TOPGRADE_NO_SELF_UPGRADE", "")
|
||||||
.exec();
|
.exec();
|
||||||
Err(err).context(ErrorKind::SelfUpdate)?
|
Err(err).context(ErrorKind::SelfUpdate)?
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user