diff --git a/Cargo.lock b/Cargo.lock index 9ddb727..676b012 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -458,6 +458,7 @@ dependencies = [ "env_logger", "indoc", "insta", + "junction", "log", "pretty_assertions", "reqwest", @@ -763,6 +764,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "junction" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be39922b087cecaba4e2d5592dedfc8bda5d4a5a1231f143337cca207950b61d" +dependencies = [ + "scopeguard", + "winapi", +] + [[package]] name = "lazy_static" version = "1.4.0" diff --git a/Cargo.toml b/Cargo.toml index f97b0ac..957305c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,3 +42,4 @@ embed-resource = "1.6.3" [target.'cfg(windows)'.dependencies] csv = "1.1.6" +junction = "0.2.0" diff --git a/README.md b/README.md index e1f7ac2..b9942b3 100644 --- a/README.md +++ b/README.md @@ -139,16 +139,6 @@ fnm env | source #### PowerShell -Before adding any configuration to your shell, you'd need to enable symlink support for a standard accounts (non-administrator). - -You can do it by enabling [Developer Mode](https://docs.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development), or [updating the Local Security Policy](#local-security-policy). - -##### Local Security Policy - -Open `Local Security Policy` (`secpol.msc`) and go to `Local Policies` -> `User Rights Assignment`, select `Create symbolic links`, add your user to the list and **reboot**. - -> Use `whoami` if you are not sure what's your user name. - Add the following to the end of your profile file: ```powershell diff --git a/src/fs.rs b/src/fs.rs index 877680e..5108926 100644 --- a/src/fs.rs +++ b/src/fs.rs @@ -8,7 +8,7 @@ pub fn symlink_dir, U: AsRef>(from: P, to: U) -> std::io::R #[cfg(windows)] pub fn symlink_dir, U: AsRef>(from: P, to: U) -> std::io::Result<()> { - std::os::windows::fs::symlink_dir(from, to)?; + junction::create(from, to)?; Ok(()) }