Implement respawn after upgrade in Windows
This commit is contained in:
13
src/error.rs
13
src/error.rs
@@ -44,6 +44,10 @@ pub enum ErrorKind {
|
||||
|
||||
#[fail(display = "A step should be skipped")]
|
||||
SkipStep,
|
||||
|
||||
#[cfg(all(windows, feature = "self-update"))]
|
||||
#[fail(display = "Topgrade Upgraded")]
|
||||
Upgraded(ExitStatus),
|
||||
}
|
||||
|
||||
impl Fail for Error {
|
||||
@@ -66,6 +70,15 @@ impl Error {
|
||||
pub fn kind(&self) -> ErrorKind {
|
||||
*self.inner.get_context()
|
||||
}
|
||||
|
||||
#[cfg(all(windows, feature = "self-update"))]
|
||||
pub fn upgraded(&self) -> bool {
|
||||
if let ErrorKind::Upgraded(_) = self.kind() {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ErrorKind> for Error {
|
||||
|
||||
Reference in New Issue
Block a user