From 0bed4d3e5153aaf2e06fb6579ac6f24acf63567f Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Sat, 9 Mar 2024 09:07:29 +0530 Subject: fix(ext/node): support junction symlinks on Windows (#22762) Fixes https://github.com/denoland/deno/issues/20609 Vitepress support! `vitepress dev` and `vitepress build` via BYONM --- ext/fs/Cargo.toml | 1 + ext/fs/interface.rs | 2 ++ ext/fs/std_fs.rs | 3 +++ 3 files changed, 6 insertions(+) (limited to 'ext/fs') diff --git a/ext/fs/Cargo.toml b/ext/fs/Cargo.toml index f6f64010e..b8cccde28 100644 --- a/ext/fs/Cargo.toml +++ b/ext/fs/Cargo.toml @@ -35,3 +35,4 @@ nix.workspace = true [target.'cfg(windows)'.dependencies] winapi = { workspace = true, features = ["winbase"] } +junction.workspace = true diff --git a/ext/fs/interface.rs b/ext/fs/interface.rs index 8ffa61481..c5a348eb1 100644 --- a/ext/fs/interface.rs +++ b/ext/fs/interface.rs @@ -64,6 +64,8 @@ pub enum FsFileType { File, #[serde(rename = "dir")] Directory, + #[serde(rename = "junction")] + Junction, } #[derive(Serialize)] diff --git a/ext/fs/std_fs.rs b/ext/fs/std_fs.rs index c1c9200cb..332866e45 100644 --- a/ext/fs/std_fs.rs +++ b/ext/fs/std_fs.rs @@ -810,6 +810,9 @@ fn symlink( FsFileType::Directory => { std::os::windows::fs::symlink_dir(oldpath, newpath)?; } + FsFileType::Junction => { + junction::create(oldpath, newpath)?; + } }; Ok(()) -- cgit v1.2.3