Skip to content

Commit

Permalink
fix: open workflow on empty selection
Browse files Browse the repository at this point in the history
  • Loading branch information
willbchang committed Jun 28, 2020
1 parent df2ef53 commit af9d4ca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
editor = ARGV[1]
# Remove single quote around file path when selecting from Alfred File Browser
filepath = /^'.*'$/.match?(filepath) ? filepath[1..-2] : filepath
system "open -a #{editor.shellescape} #{filepath.shellescape}"
system "open -a #{editor.shellescape} " +
"#{filepath.shellescape if File.exist?(filepath)}"

0 comments on commit af9d4ca

Please sign in to comment.