Compare commits
No commits in common. "beb880ed43466bc38dba78bd05704fcb82fe01f7" and "1b51633d4fe897dd34c3106cd2a220229c4762f5" have entirely different histories.
beb880ed43
...
1b51633d4f
4 changed files with 3 additions and 7 deletions
|
@ -135,9 +135,6 @@ Default: '>'
|
||||||
.It Ev REMUX_NEW_WINDOW
|
.It Ev REMUX_NEW_WINDOW
|
||||||
Provides a default windows name when creating a new session. Unused if empty.
|
Provides a default windows name when creating a new session. Unused if empty.
|
||||||
Default: (unset)
|
Default: (unset)
|
||||||
.It Ev REMUX_REPO_FILE
|
|
||||||
The filename to match on when trying to find the root of a repository.
|
|
||||||
Default: '.git'
|
|
||||||
.El
|
.El
|
||||||
.Sh EXIT STATUS
|
.Sh EXIT STATUS
|
||||||
.Bl -tag -Width Ds
|
.Bl -tag -Width Ds
|
||||||
|
|
|
@ -5,7 +5,6 @@ pub type EnvVar = (&'static str, &'static str);
|
||||||
pub static ATTACH_SYMBOL: EnvVar = ("REMUX_ATTACH_SYMBOL", "*");
|
pub static ATTACH_SYMBOL: EnvVar = ("REMUX_ATTACH_SYMBOL", "*");
|
||||||
pub static CURRENT_SYMBOL: EnvVar = ("REMUX_CURRENT_SYMBOL", ">");
|
pub static CURRENT_SYMBOL: EnvVar = ("REMUX_CURRENT_SYMBOL", ">");
|
||||||
pub static NEW_WINDOW_NAME: EnvVar = ("REMUX_NEW_WINDOW", "");
|
pub static NEW_WINDOW_NAME: EnvVar = ("REMUX_NEW_WINDOW", "");
|
||||||
pub static REPO_FILE: EnvVar = ("REMUX_REPO_FILE", ".git");
|
|
||||||
|
|
||||||
pub static TMUX: &str = "TMUX";
|
pub static TMUX: &str = "TMUX";
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ use std::{
|
||||||
use pico_args::Arguments;
|
use pico_args::Arguments;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
env::{ env_var, REPO_FILE, TMUX },
|
env::TMUX,
|
||||||
error,
|
error,
|
||||||
flag::Flags,
|
flag::Flags,
|
||||||
util::{ find, session_name }
|
util::{ find, session_name }
|
||||||
|
@ -82,7 +82,7 @@ pub struct Repository {
|
||||||
|
|
||||||
impl Repository {
|
impl Repository {
|
||||||
pub fn find() -> Option<Repository> {
|
pub fn find() -> Option<Repository> {
|
||||||
let path = find(&env_var(REPO_FILE), env::current_dir().unwrap());
|
let path = find(".git", env::current_dir().unwrap());
|
||||||
if let Some(path) = path {
|
if let Some(path) = path {
|
||||||
let name = path.file_name().unwrap().to_string_lossy().to_string();
|
let name = path.file_name().unwrap().to_string_lossy().to_string();
|
||||||
let inner = Repository {
|
let inner = Repository {
|
||||||
|
|
|
@ -51,7 +51,7 @@ pub fn terminal_enforce() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// recursively propagate up directories to find a child
|
/// recursively propagate up directories to find a child
|
||||||
pub fn find(target: &str, path: PathBuf) -> Option<PathBuf> {
|
pub fn find(target: &'static str, path: PathBuf) -> Option<PathBuf> {
|
||||||
if path.join(target).exists() { return Some(path); }
|
if path.join(target).exists() { return Some(path); }
|
||||||
|
|
||||||
let parent = path.parent();
|
let parent = path.parent();
|
||||||
|
|
Loading…
Reference in a new issue