Skip to content

Commit

Permalink
check for directory regardless of wraith mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisBAshton committed Apr 25, 2016
1 parent 252eb23 commit fe519eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions lib/wraith/validate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ def validate(mode = false)
end

def validate_basic_properties
if wraith.engine.nil?
fail MissingRequiredPropertyError, "You must specify a browser engine! #{docs_prompt}"
end
unless wraith.domains
fail MissingRequiredPropertyError, "You must specify at least one domain for Wraith to do anything! #{docs_prompt}"
end
fail MissingRequiredPropertyError, "You must specify a browser engine! #{docs_prompt}" if wraith.engine.nil?

fail MissingRequiredPropertyError, "You must specify at least one domain for Wraith to do anything! #{docs_prompt}" unless wraith.domains

fail MissingRequiredPropertyError, "You must specify a directory for capture! #{docs_prompt}" if wraith.directory.nil?

# @TODO validate fuzz is not nil, etc
end

Expand All @@ -45,8 +45,6 @@ def validate_mode_properties(mode)
def validate_capture_mode
fail InvalidDomainsError, "`wraith capture` requires exactly two domains. #{docs_prompt}" if wraith.domains.length != 2

fail MissingRequiredPropertyError, "You must specify a directory for capture! #{docs_prompt}" if wraith.directory.nil?

logger.warn "You have specified a `history_dir` in your config, but this is"\
" used in `history` mode, NOT `capture` mode. #{docs_prompt}" if wraith.history_dir
end
Expand Down
2 changes: 1 addition & 1 deletion lib/wraith/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Wraith
VERSION = "3.1.5"
VERSION = "3.1.6"
end

0 comments on commit fe519eb

Please sign in to comment.