Skip to content

Commit

Permalink
check if output is aborted
Browse files Browse the repository at this point in the history
  • Loading branch information
femnad committed Jan 5, 2023
1 parent 8dcbe4a commit 648e6e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 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 = "leth"
version = "0.4.1"
version = "0.5.0"
authors = ["fcd <[email protected]>"]
edition = "2018"

Expand Down
9 changes: 5 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ pub fn main() {
let item_reader = SkimItemReader::default();
let items = item_reader.of_bufread(Cursor::new(items));

let selected_items = Skim::run_with(&options, Some(items))
.map(|out| out.selected_items)
.unwrap_or_else(|| Vec::new());
let output = Skim::run_with(&options, Some(items)).unwrap();
if output.is_abort {
return;
}

for item in selected_items.iter() {
for item in output.selected_items.iter() {
let url = item.clone();
Command::new("firefox")
.arg(url.output().as_ref())
Expand Down

0 comments on commit 648e6e5

Please sign in to comment.