We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 89b7aa2 commit 686cc18Copy full SHA for 686cc18
src/cortex-cli/src/utils/paths.rs
@@ -39,10 +39,10 @@ pub fn expand_tilde(path: &str) -> String {
39
if let Some(home) = dirs::home_dir() {
40
return home.to_string_lossy().to_string();
41
}
42
- } else if path.starts_with("~/") {
+ } else if let Some(suffix) = path.strip_prefix("~/") {
43
// Handle "~/" prefix - expand to home directory + rest of path
44
45
- return home.join(&path[2..]).to_string_lossy().to_string();
+ return home.join(suffix).to_string_lossy().to_string();
46
47
48
path.to_string()
0 commit comments