tempomat 0.3.0

Minimal Tempo+Jira time logging CLI
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::{
    error::TempomatError,
    jira::{self, types::JiraIssueKey},
};
use std::process::Command;

pub fn get_current_branch_key() -> Result<Option<JiraIssueKey>, TempomatError> {
    let output = Command::new("git")
        .args(["branch", "--show-current"])
        .output()?;
    let text = String::from_utf8(output.stdout)?;

    Ok(jira::parse_issue_key_fuzzy(&text))
}