Skip to content

Commit

Permalink
better fix for conditionally compiling the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mikrostew committed Aug 16, 2018
1 parent c1e8472 commit fa1f646
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions crates/notion-core/src/path/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
//! in a standard Notion layout in Windows operating systems.

use std::path::PathBuf;
// using std::os instead of std::os::windows because that was causing `cargo doc --features universal-docs` to fail
use std::os;
#[cfg(windows)]
use std::os::windows;
use std::io;

use winfolder;
Expand Down Expand Up @@ -49,6 +49,7 @@ fn program_data_root() -> Fallible<PathBuf> {
#[cfg(windows)]
return Ok(winfolder::Folder::ProgramData.path().join("Notion"));

// "universal-docs" is built on a Unix machine, so we can't include Windows-specific libs
#[cfg(feature = "universal-docs")]
unimplemented!()
}
Expand Down Expand Up @@ -117,6 +118,7 @@ fn program_files_root() -> Fallible<PathBuf> {
#[cfg(windows)]
return Ok(winfolder::Folder::ProgramFilesX64.path().join("Notion"));

// "universal-docs" is built on a Unix machine, so we can't include Windows-specific libs
#[cfg(feature = "universal-docs")]
unimplemented!()
}
Expand Down Expand Up @@ -146,6 +148,7 @@ fn local_data_root() -> Fallible<PathBuf> {
#[cfg(windows)]
return Ok(winfolder::Folder::LocalAppData.path().join("Notion"));

// "universal-docs" is built on a Unix machine, so we can't include Windows-specific libs
#[cfg(feature = "universal-docs")]
unimplemented!()
}
Expand All @@ -159,5 +162,10 @@ pub fn user_catalog_file() -> Fallible<PathBuf> {
}

pub fn create_file_symlink(src: PathBuf, dst: PathBuf) -> Result<(), io::Error> {
os::windows::fs::symlink_file(src, dst)
#[cfg(windows)]
return windows::fs::symlink_file(src, dst);

// "universal-docs" is built on a Unix machine, so we can't include Windows-specific libs
#[cfg(feature = "universal-docs")]
unimplemented!()
}

0 comments on commit fa1f646

Please sign in to comment.