rsmultigit 0.1.2

Manage multiple git repositories at once
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::path::Path;
use std::process::Command;

use anyhow::Result;

/// Show the most recent tag. Returns None if no tags exist.
pub fn do_last_tag(_project: &Path) -> Result<Option<String>> {
    let output = Command::new("git")
        .args(["describe", "--tags", "--abbrev=0"])
        .output()?;
    let stdout = String::from_utf8_lossy(&output.stdout).trim().to_string();
    if output.status.success() && !stdout.is_empty() {
        Ok(Some(stdout))
    } else {
        Ok(None)
    }
}