Skip to content

Commit

Permalink
Lets make this non-unix specific for our windows based friends (#134)
Browse files Browse the repository at this point in the history
Co-authored-by: Esteban Blanc <[email protected]>
  • Loading branch information
mr-bo-jangles and Skallwar authored Jul 7, 2021
1 parent 776cada commit 7bb91b1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ encoding_rs = "^0.8"
lazy_static = "1.4.0"
pathdiff = "^0.2"
md5 = "^0.7"
symlink = "^0.1.0"

[dev-dependencies]
tiny_http = "^0.8"
Expand Down
3 changes: 2 additions & 1 deletion src/disk.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::fs;
use std::io::Write;
use std::path::PathBuf;
use symlink::symlink_auto;

use crate::{error, warn};

Expand Down Expand Up @@ -37,7 +38,7 @@ pub fn symlink(source: &str, destination: &str, path: &Option<PathBuf>) {
None => PathBuf::from(destination),
};

if let Err(_) = std::os::unix::fs::symlink(source, &destination) {
if let Err(_) = symlink_auto(source, &destination) {
warn!(
"{} is already present, coulnd't create a symlink to {}",
destination.display(),
Expand Down

0 comments on commit 7bb91b1

Please sign in to comment.