Skip to content

Commit

Permalink
fix: correct symlink to symlink_file on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Apr 14, 2024
1 parent 41f4a4a commit d1ca9ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use walkdir::WalkDir;
use std::os::unix::fs::{symlink, FileTypeExt, PermissionsExt};

#[cfg(target_os = "windows")]
use std::os::windows::fs::{symlink, FileTypeExt};
use std::os::windows::fs::symlink_file as symlink;

pub mod args;
pub mod completions;
Expand Down Expand Up @@ -51,10 +51,10 @@ pub fn run(cli: Args, mode: impl util::TestingMode, stream: &mut impl Write) ->

if !graveyard.exists() {
fs::create_dir_all(graveyard)?;
let metadata = graveyard.metadata()?;

#[cfg(unix)]
{
let metadata = graveyard.metadata()?;
let mut permissions = metadata.permissions();
permissions.set_mode(0o700);
}
Expand Down
6 changes: 3 additions & 3 deletions tests/unit_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ use tempfile::tempdir;
#[cfg(unix)]
use std::os::unix::fs::symlink;

#[cfg(target_os = "windows")]
use std::os::windows::fs::symlink_file as symlink;

#[cfg(unix)]
use std::os::unix::net::UnixListener;

#[cfg(target_os = "macos")]
use std::os::unix::fs::FileTypeExt;

#[cfg(target_os = "windows")]
use std::os::windows::fs::symlink;

#[rstest]
fn test_validation() {
let bad_completions = Args {
Expand Down

0 comments on commit d1ca9ca

Please sign in to comment.