We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f0213f commit c72cb9eCopy full SHA for c72cb9e
src/utils/raw.rs
@@ -134,10 +134,9 @@ pub fn append_file(dest: &Path, line: &str) -> io::Result<()> {
134
pub fn symlink_dir(src: &Path, dest: &Path) -> io::Result<()> {
135
#[cfg(windows)]
136
fn symlink_dir_inner(src: &Path, dest: &Path) -> io::Result<()> {
137
- // std's symlink uses Windows's symlink function, which requires
138
- // admin. We can create directory junctions the hard way without
139
- // though.
140
- symlink_junction_inner(src, dest)
+ // On Windows creating symlinks isn't allowed by default so if it fails
+ // we fallback to creating a directory junction.
+ std::os::windows::fs::symlink_dir(src, dest).or_else(|_| symlink_junction_inner(src, dest))
141
}
142
#[cfg(not(windows))]
143
0 commit comments