github-gem
github-gem copied to clipboard
'gh browse' checks for launchy & fails if launchy installed, but not through gems
The 'browse' command determines if I have launchy installed in the following fashion:
helper :has_launchy? do |blk|
begin
gem 'launchy'
require 'launchy'
blk.call
rescue Gem::LoadError
STDERR.puts "Sorry, you need to install launchy: `gem install launchy`"
end
end
Except that in some cases, I may have installed launchy through other means, such as using a package (e.g. the Debian/Ubuntu policy favors packages over gems, so this will apply when launchy is eventually packaged, or even right now using the most excellent thwarted/gem2deb ). In those cases, commenting gem 'launchy' above suffices to get 'gh browse' running.
We could attempt to load it directly first, without gems, then failover to gems, then show the error?
Yes, along the lines of something defunkt himself mentioned.