gimmetool 0.1.3

A multi-repo manager that lets you jump between projects, pin favorites, clean stale branches, and alias repos — all from one CLI
1
2
3
4
5
6
7
8
9
10
11
use std::path::PathBuf;

/// Returns the gimme config directory, respecting $XDG_CONFIG_HOME.
/// Defaults to ~/.config/gimme/ when XDG_CONFIG_HOME is not set.
pub fn gimme_dir() -> Option<PathBuf> {
  let base = match std::env::var("XDG_CONFIG_HOME") {
    Ok(val) if !val.is_empty() => PathBuf::from(val),
    _ => dirs::home_dir()?.join(".config"),
  };
  Some(base.join("gimme"))
}