Add doc comment
This commit is contained in:
@ -9,9 +9,10 @@ use crate::error::{FileReadError, FileWriteError, PeachConfigError};
|
|||||||
use crate::utils::get_output;
|
use crate::utils::get_output;
|
||||||
use crate::RtcOption;
|
use crate::RtcOption;
|
||||||
|
|
||||||
|
/// Helper function which returns the version of a package currently installed,
|
||||||
|
/// as an Ok(String) if found, and as an Err if not found
|
||||||
pub fn get_package_version_number(package: &str) -> Result<String, PeachConfigError> {
|
pub fn get_package_version_number(package: &str) -> Result<String, PeachConfigError> {
|
||||||
let version = get_output(&["dpkg-query", "--showformat='${Version}'", "--show", package])?;
|
let version = get_output(&["dpkg-query", "--showformat='${Version}'", "--show", package])?;
|
||||||
debug!("version: {:?}", version);
|
|
||||||
Ok(version)
|
Ok(version)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user