Skip to content

Commit

Permalink
Handle empty vendor cache
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Schwaderer <nschwaderer@chef.io>
  • Loading branch information
Nick Schwaderer committed Oct 21, 2020
1 parent 70aa629 commit 1dafa1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/inspec/cli.rb
Expand Up @@ -399,7 +399,8 @@ def version
def clear_cache
o = config
configure_logger(o)
FileUtils.rm_r Dir.glob(File.expand_path(o[:vendor_cache]))
cache_path = o[:vendor_cache] || "~/.inspec/cache"
FileUtils.rm_r Dir.glob(File.expand_path(cache_path))

o[:logger] = Logger.new($stdout)
o[:logger].level = get_log_level(o[:log_level])
Expand Down

0 comments on commit 1dafa1a

Please sign in to comment.