diff --git a/lib/bundler/audit/cli.rb b/lib/bundler/audit/cli.rb index 49a167b4..11adc604 100644 --- a/lib/bundler/audit/cli.rb +++ b/lib/bundler/audit/cli.rb @@ -33,11 +33,12 @@ class CLI < ::Thor method_option :verbose, :type => :boolean, :aliases => '-v' method_option :ignore, :type => :array, :aliases => '-i' method_option :update, :type => :boolean, :aliases => '-u' + method_option :project_root, :type => :string, :aliases => '-p' def check update if options[:update] - scanner = Scanner.new + scanner = Scanner.new(options.fetch(:project_root, Dir.pwd)) vulnerable = false scanner.scan(:ignore => options.ignore) do |result| diff --git a/lib/bundler/audit/scanner.rb b/lib/bundler/audit/scanner.rb index a989935a..a4c4719a 100644 --- a/lib/bundler/audit/scanner.rb +++ b/lib/bundler/audit/scanner.rb @@ -36,7 +36,7 @@ class Scanner # @param [String] root # The path to the project root. # - def initialize(root=Dir.pwd) + def initialize(root) @root = File.expand_path(root) @database = Database.new @lockfile = LockfileParser.new(