Skip to content

Commit

Permalink
Use homedir instead of ~ for empty cd
Browse files Browse the repository at this point in the history
  • Loading branch information
prsabahrami committed Sep 6, 2024
1 parent 9570448 commit aaa108d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/deno_task_shell/src/shell/commands/cd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ fn execute_cd(cwd: &Path, args: Vec<String>) -> Result<PathBuf> {
let mut args = args;
if args.is_empty() {
// append homedir to args
args.push("~".to_string());
let home_dir = dirs::home_dir().unwrap();
args.push(home_dir.to_string_lossy().to_string());
}
let path = parse_args(args.clone())?;
let new_dir = cwd.join(&path);
Expand Down

0 comments on commit aaa108d

Please sign in to comment.