Skip to content

Commit

Permalink
Freebsd fix compilation (#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Dilly authored Dec 22, 2020
1 parent c19567e commit 5080b82
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<!-- ## Unreleased -->
## Unreleased

### Fixed
- compilation broken on freebsd ([#461](https://github.com/extrawurst/gitui/issues/461))

## [0.11.0] - 2020-12-20

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ anyhow = "1.0.36"
unicode-width = "0.1"
textwrap = "0.13"

[target.'cfg(target_os = "linux")'.dependencies]
[target.'cfg(all(target_family="unix",not(target_os="macos")))'.dependencies]
which = "4.0"

# pprof is not available on windows
Expand Down
7 changes: 4 additions & 3 deletions src/clipboard.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use anyhow::{anyhow, Result};
#[cfg(target_os = "linux")]
#[cfg(target_family = "unix")]
#[cfg(not(target_os = "macos"))]
use std::ffi::OsStr;
use std::io::Write;
use std::process::{Command, Stdio};
Expand Down Expand Up @@ -27,7 +28,7 @@ fn execute_copy_command(command: Command, text: &str) -> Result<()> {
Ok(())
}

#[cfg(target_os = "linux")]
#[cfg(all(target_family = "unix", not(target_os = "macos")))]
fn gen_command(
path: impl AsRef<OsStr>,
xclip_syntax: bool,
Expand All @@ -42,7 +43,7 @@ fn gen_command(
c
}

#[cfg(target_os = "linux")]
#[cfg(all(target_family = "unix", not(target_os = "macos")))]
pub fn copy_string(string: &str) -> Result<()> {
use std::path::PathBuf;
use which::which;
Expand Down

0 comments on commit 5080b82

Please sign in to comment.