bin/ronin-urls in ronin-1.5.0 vs bin/ronin-urls in ronin-1.5.1
- old
+ new
@@ -1,25 +1,20 @@
#!/usr/bin/env ruby
require 'rubygems'
-root_dir = File.expand_path(File.join(File.dirname(__FILE__),'..'))
-if File.directory?(File.join(root_dir,'.git'))
- Dir.chdir(root_dir) do |path|
- require 'bundler'
-
+root = File.expand_path(File.join(File.dirname(__FILE__),'..'))
+if File.file?(File.join(root,'Gemfile.lock'))
+ Dir.chdir(root) do
begin
- Bundler.setup(:default)
- rescue Bundler::BundlerError => e
+ require 'bundler/setup'
+ rescue LoadError => e
warn e.message
- warn "Run `bundle install` to install missing gems"
- exit e.status_code
+ warn "Run `gem install bundler` to install Bundler"
+ exit -1
end
end
end
-
-lib_dir = File.join(root_dir,'lib')
-$LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
require 'ronin/ui/cli/commands/urls'
Ronin::UI::CLI::Commands::Urls.start