Skip to content

Commit

Permalink
fix: error command status
Browse files Browse the repository at this point in the history
  • Loading branch information
MystiPanda committed Jul 16, 2024
1 parent ff28aab commit c4abc3a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src-tauri/src/core/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub async fn install_service(passwd: String) -> Result<()> {
sudo(&passwd, format!("{}", installer_path.to_string_lossy())).output()?
}
};
if output.stderr.len() > 0 {
if !output.status.success() {
bail!(
"failed to install service with error: {}",
String::from_utf8_lossy(&output.stderr)
Expand Down Expand Up @@ -141,8 +141,7 @@ pub async fn install_service(passwd: String) -> Result<()> {
)
.output()?;

// MacOS default outout "Password:" in stderr
if output.stderr.len() > 10 {
if !output.status.success() {
bail!(
"failed to install service with error: {}",
String::from_utf8_lossy(&output.stderr)
Expand Down Expand Up @@ -215,7 +214,8 @@ pub async fn uninstall_service(passwd: String) -> Result<()> {
sudo(&passwd, format!("{}", uninstaller_path.to_string_lossy())).output()?
}
};
if output.stderr.len() > 0 {

if !output.status.success() {
bail!(
"failed to install service with error: {}",
String::from_utf8_lossy(&output.stderr)
Expand Down Expand Up @@ -248,8 +248,7 @@ pub async fn uninstall_service(passwd: String) -> Result<()> {
)
.output()?;

// MacOS default outout "Password:" in stderr
if output.stderr.len() > 10 {
if !output.status.success() {
bail!(
"failed to uninstall service with error: {}",
String::from_utf8_lossy(&output.stderr)
Expand Down

0 comments on commit c4abc3a

Please sign in to comment.