From bc1a837b686c81ff08edfd6b211c3f5f356bbcab Mon Sep 17 00:00:00 2001 From: Adam Sanderson Date: Wed, 8 Dec 2010 07:49:20 -0800 Subject: [PATCH] Added a check to make sure that editor was set. --- lib/qwandry/launcher.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/qwandry/launcher.rb b/lib/qwandry/launcher.rb index a06ef9f..2b1d4f3 100644 --- a/lib/qwandry/launcher.rb +++ b/lib/qwandry/launcher.rb @@ -63,6 +63,12 @@ module Qwandry # check against the environment by default. def launch(package, editor=nil) editor ||= @editor || ENV['VISUAL'] || ENV['EDITOR'] + + if (!editor) || (editor =~ /^\s*$/) # if the editor is not set, or is blank, exit with a message: + puts "Please either set EDITOR or pass in an editor to use" + exit 1 + end + paths = package.is_a?(String) ? [package] : package.paths system editor, *paths end