From af9d4ca54155b78b7c4bac052b3b3be1a7c78de6 Mon Sep 17 00:00:00 2001 From: Will B Chang Date: Sun, 28 Jun 2020 15:18:26 +0800 Subject: [PATCH] fix: open workflow on empty selection --- script.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script.rb b/script.rb index 8b68a07..b1cf5f9 100644 --- a/script.rb +++ b/script.rb @@ -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)}"