Initial commit for fern

This commit is contained in:
2025-03-02 16:26:28 -05:00
parent 56917524c3
commit a9a9642a2a
40 changed files with 5281 additions and 0 deletions

11
src/expand/tilde.rs Normal file
View File

@@ -0,0 +1,11 @@
use crate::prelude::*;
pub fn expand_tilde(tilde_sub: Token) -> String {
let tilde_sub_raw = tilde_sub.to_string();
if tilde_sub_raw.starts_with('~') {
let home = std::env::var("HOME").unwrap_or_default();
tilde_sub_raw.replacen('~', &home, 1)
} else {
tilde_sub_raw
}
}