diff --git a/crates/distribution-types/src/installed.rs b/crates/distribution-types/src/installed.rs index 9179fc28a..56ac0aaac 100644 --- a/crates/distribution-types/src/installed.rs +++ b/crates/distribution-types/src/installed.rs @@ -111,6 +111,16 @@ impl InstalledDist { }) } + /// Return the `INSTALLER` of the distribution. + pub fn installer(&self) -> Result> { + let path = self.path().join("INSTALLER"); + match fs::read_to_string(path) { + Ok(installer) => Ok(Some(installer)), + Err(err) if err.kind() == std::io::ErrorKind::NotFound => Ok(None), + Err(err) => Err(err.into()), + } + } + /// Return the [`Url`] of the distribution, if it is editable. pub fn as_editable(&self) -> Option<&Url> { match self {