Skip to main content

Vcs

Trait Vcs 

Source
pub trait Vcs {
    // Required methods
    fn is_repo(&self, root: &Path) -> bool;
    fn init_repo(&self, root: &Path) -> Result<(), JoyError>;
    fn user_email(&self) -> Result<String, JoyError>;
    fn version_tags(&self, root: &Path) -> Result<Vec<String>, JoyError>;
    fn latest_version_tag(
        &self,
        root: &Path,
    ) -> Result<Option<String>, JoyError>;
}
Expand description

VCS read operations that Joy needs.

Required Methods§

Source

fn is_repo(&self, root: &Path) -> bool

Check if the given directory is inside a VCS repository.

Source

fn init_repo(&self, root: &Path) -> Result<(), JoyError>

Initialize a new repository at the given path.

Source

fn user_email(&self) -> Result<String, JoyError>

Get the current user’s email from VCS config.

Source

fn version_tags(&self, root: &Path) -> Result<Vec<String>, JoyError>

List all version tags (e.g. v0.5.0), sorted descending.

Source

fn latest_version_tag(&self, root: &Path) -> Result<Option<String>, JoyError>

Get the latest reachable version tag, if any.

Implementors§