-
-
Notifications
You must be signed in to change notification settings - Fork 581
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
revert clipboard feature on linux to fix static linux binary build (#261
- Loading branch information
Stephan Dilly
authored
Aug 31, 2020
1 parent
9be119a
commit e5c38e8
Showing
8 changed files
with
66 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "gitui" | ||
version = "0.10.0" | ||
version = "0.10.1" | ||
authors = ["Stephan Dilly <[email protected]>"] | ||
description = "blazing fast terminal-ui for git" | ||
edition = "2018" | ||
|
@@ -40,7 +40,7 @@ serde = "1.0" | |
anyhow = "1.0.32" | ||
unicode-width = "0.1" | ||
textwrap = "0.12" | ||
clipboard = "0.5" | ||
clipboard = { version = "0.5", optional = true } | ||
|
||
[target.'cfg(not(windows))'.dependencies] | ||
pprof = { version = "0.3", features = ["flamegraph"], optional = true } | ||
|
@@ -49,7 +49,7 @@ pprof = { version = "0.3", features = ["flamegraph"], optional = true } | |
maintenance = { status = "actively-developed" } | ||
|
||
[features] | ||
default=[] | ||
default=["clipboard"] | ||
timing=["scopetime/enabled"] | ||
|
||
[workspace] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use anyhow::Result; | ||
#[cfg(feature = "clipboard")] | ||
use clipboard::{ClipboardContext, ClipboardProvider}; | ||
|
||
#[cfg(feature = "clipboard")] | ||
pub fn copy_string(string: String) -> Result<()> { | ||
use anyhow::anyhow; | ||
|
||
let mut ctx: ClipboardContext = ClipboardProvider::new() | ||
.map_err(|_| anyhow!("failed to get access to clipboard"))?; | ||
ctx.set_contents(string) | ||
.map_err(|_| anyhow!("failed to set clipboard contents"))?; | ||
|
||
Ok(()) | ||
} | ||
|
||
#[cfg(not(feature = "clipboard"))] | ||
pub fn copy_string(_string: String) -> Result<()> { | ||
Ok(()) | ||
} | ||
|
||
#[cfg(feature = "clipboard")] | ||
pub fn is_supported() -> bool { | ||
true | ||
} | ||
|
||
#[cfg(not(feature = "clipboard"))] | ||
pub fn is_supported() -> bool { | ||
false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters