summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin Wernick <justin@worthe-it.co.za>2023-03-20 23:34:50 +0200
committerJustin Wernick <justin@worthe-it.co.za>2023-03-20 23:34:50 +0200
commita62fa84b0bb5abe3a2c52a047f47b6403ffcd54c (patch)
tree7efd7e60d5d046b1239c91beb3e9d9cc45e9839e /src
parent2b827a0ab06fb715290a0450a3fff56d3e6f4ee6 (diff)
Move user info gathering to its own workspace crate
Diffstat (limited to 'src')
-rw-r--r--src/git.rs2
-rw-r--r--src/lib.rs1
-rw-r--r--src/user.rs7
3 files changed, 1 insertions, 9 deletions
diff --git a/src/git.rs b/src/git.rs
index 753f53a..24b376d 100644
--- a/src/git.rs
+++ b/src/git.rs
@@ -1,10 +1,10 @@
use crate::{
parser::{GitReceivePackArgs, GitUploadPackArgs},
- user::get_username,
ShackleError,
};
use git2::{Repository, RepositoryInitOptions};
use std::{path::PathBuf, process::Command};
+use user_info::get_username;
pub struct GitInitResult {
pub path: PathBuf,
diff --git a/src/lib.rs b/src/lib.rs
index b645918..99d8877 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,6 +1,5 @@
pub mod git;
pub mod parser;
-pub mod user;
use parser::*;
use rustyline::error::ReadlineError;
diff --git a/src/user.rs b/src/user.rs
deleted file mode 100644
index 72aea8d..0000000
--- a/src/user.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-pub fn get_username() -> Option<String> {
- let uid = nix::unistd::getuid();
- nix::unistd::User::from_uid(uid)
- .ok()
- .flatten()
- .map(|user| user.name)
-}