Skip to content

Commit

Permalink
doc: add notes to shell config
Browse files Browse the repository at this point in the history
  • Loading branch information
matzxrr committed Jan 29, 2024
1 parent 702378e commit 87cd05a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dotme-core/src/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ pub struct ShellConfig {
}

impl ShellConfig {
/// This should load the users shell information
/// Currently only works if the SHELL env variable is set
///
/// TODO: Need to find fallback ways of checking a users shell
pub fn load() -> Result<ShellConfig> {
let shell_result = env::var("SHELL");
if let Ok(shell_path) = shell_result {
Expand Down Expand Up @@ -64,4 +68,13 @@ mod shell_tests {
assert_eq!(&shell.file, ".bashrc");
assert_eq!(&shell.path, "/bin/bash");
}

#[test]
fn test_something() {
if let Ok(exe_path) = env::current_exe() {
if let Some(parent) = exe_path.parent() {
println!("{}", parent.display());
}
}
}
}

0 comments on commit 87cd05a

Please sign in to comment.