Skip to content

Commit

Permalink
Handle spaces in fn url::open (#333)
Browse files Browse the repository at this point in the history
Fixes #331
  • Loading branch information
denisidoro authored Apr 10, 2020
1 parent c81aa29 commit 72cf882
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/flows/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub fn main(func: String, args: Vec<String>) -> Result<(), Error> {
.into_iter()
.next()
.ok_or_else(|| anyhow!("No URL specified"))?;
let cmd = format!("url=\"{}\"; (xdg-open \"$url\" 2> /dev/null || open \"$url\" 2> /dev/null) &disown", url);
let cmd = format!("url=\"$(echo \"{}\" | tr ' ' '+')\"; (xdg-open \"$url\" 2> /dev/null || open \"$url\" 2> /dev/null) &disown", url);
Command::new("bash")
.arg("-c")
.arg(cmd.as_str())
Expand Down

0 comments on commit 72cf882

Please sign in to comment.