Skip to content

Commit

Permalink
ignore STDIN.txt that sometimes gets uploaded
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Lindsey authored and Josh Lindsey committed Oct 15, 2018
1 parent 678d5ab commit 1b9da47
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "screencat"
version = "1.1.1"
version = "1.1.2"
description = "Screenshot auto-uploader with Sendcat"
authors = ["Josh Lindsey <[email protected]>"]
license = "GPL-3.0-or-later"
Expand Down
8 changes: 7 additions & 1 deletion src/fs_watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,13 @@ impl FSWatcher {
debug!("sendcat output: {:?}", output);

let out: SendcatOutput = serde_json::from_slice(&output.stdout)?;
let url = &out.share_files[0].url;
let mut url = "";
for file in &out.share_files {
if file.url != "STDIN.txt" {
url = &file.url;
break
}
}
debug!("parsed URL from output: {}", url);

self.copy_url_to_clipboard(url)?;
Expand Down

0 comments on commit 1b9da47

Please sign in to comment.