diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/fs/Cargo.toml | 1 | ||||
-rw-r--r-- | ext/fs/interface.rs | 2 | ||||
-rw-r--r-- | ext/fs/std_fs.rs | 3 | ||||
-rw-r--r-- | ext/node/polyfills/_fs/_fs_symlink.ts | 2 |
4 files changed, 7 insertions, 1 deletions
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(()) diff --git a/ext/node/polyfills/_fs/_fs_symlink.ts b/ext/node/polyfills/_fs/_fs_symlink.ts index 5cb121755..350263423 100644 --- a/ext/node/polyfills/_fs/_fs_symlink.ts +++ b/ext/node/polyfills/_fs/_fs_symlink.ts @@ -7,7 +7,7 @@ import { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts"; import { pathFromURL } from "ext:deno_web/00_infra.js"; import { promisify } from "ext:deno_node/internal/util.mjs"; -type SymlinkType = "file" | "dir"; +type SymlinkType = "file" | "dir" | "junction"; export function symlink( target: string | URL, |