Skip to content

Commit

Permalink
feat: show friendly error message if gradle not found (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjeevprasad authored Mar 26, 2024
1 parent 61c552f commit 590dbce
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/android/aab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ pub fn build(
});
Ok(())
})
.start()?
.start()
.map_err(|err| {
if err.kind() == std::io::ErrorKind::NotFound {
log::error!("`gradlew` not found. Make sure you have the Android SDK installed and added to your PATH");
}
err
})?
.wait()?;

let mut outputs = Vec::new();
Expand Down
8 changes: 7 additions & 1 deletion src/android/apk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,13 @@ pub fn build(
});
Ok(())
})
.start()?
.start()
.map_err(|err| {
if err.kind() == std::io::ErrorKind::NotFound {
log::error!("`gradlew` not found. Make sure you have the Android SDK installed and added to your PATH");
}
err
})?
.wait()?;

let mut outputs = Vec::new();
Expand Down

0 comments on commit 590dbce

Please sign in to comment.