mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2024-11-16 03:32:36 +08:00
fix: error command status
This commit is contained in:
parent
ff28aab56e
commit
c4abc3ade3
|
@ -108,7 +108,7 @@ pub async fn install_service(passwd: String) -> Result<()> {
|
||||||
sudo(&passwd, format!("{}", installer_path.to_string_lossy())).output()?
|
sudo(&passwd, format!("{}", installer_path.to_string_lossy())).output()?
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if output.stderr.len() > 0 {
|
if !output.status.success() {
|
||||||
bail!(
|
bail!(
|
||||||
"failed to install service with error: {}",
|
"failed to install service with error: {}",
|
||||||
String::from_utf8_lossy(&output.stderr)
|
String::from_utf8_lossy(&output.stderr)
|
||||||
|
@ -141,8 +141,7 @@ pub async fn install_service(passwd: String) -> Result<()> {
|
||||||
)
|
)
|
||||||
.output()?;
|
.output()?;
|
||||||
|
|
||||||
// MacOS default outout "Password:" in stderr
|
if !output.status.success() {
|
||||||
if output.stderr.len() > 10 {
|
|
||||||
bail!(
|
bail!(
|
||||||
"failed to install service with error: {}",
|
"failed to install service with error: {}",
|
||||||
String::from_utf8_lossy(&output.stderr)
|
String::from_utf8_lossy(&output.stderr)
|
||||||
|
@ -215,7 +214,8 @@ pub async fn uninstall_service(passwd: String) -> Result<()> {
|
||||||
sudo(&passwd, format!("{}", uninstaller_path.to_string_lossy())).output()?
|
sudo(&passwd, format!("{}", uninstaller_path.to_string_lossy())).output()?
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if output.stderr.len() > 0 {
|
|
||||||
|
if !output.status.success() {
|
||||||
bail!(
|
bail!(
|
||||||
"failed to install service with error: {}",
|
"failed to install service with error: {}",
|
||||||
String::from_utf8_lossy(&output.stderr)
|
String::from_utf8_lossy(&output.stderr)
|
||||||
|
@ -248,8 +248,7 @@ pub async fn uninstall_service(passwd: String) -> Result<()> {
|
||||||
)
|
)
|
||||||
.output()?;
|
.output()?;
|
||||||
|
|
||||||
// MacOS default outout "Password:" in stderr
|
if !output.status.success() {
|
||||||
if output.stderr.len() > 10 {
|
|
||||||
bail!(
|
bail!(
|
||||||
"failed to uninstall service with error: {}",
|
"failed to uninstall service with error: {}",
|
||||||
String::from_utf8_lossy(&output.stderr)
|
String::from_utf8_lossy(&output.stderr)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user