diff --git a/lib/licensed/migrations/v2.rb b/lib/licensed/migrations/v2.rb index 20b6f890..4f687341 100644 --- a/lib/licensed/migrations/v2.rb +++ b/lib/licensed/migrations/v2.rb @@ -28,7 +28,9 @@ def self.migrate(config_path, shell = Licensed::UI::Shell.new) end app.sources.each do |source| - Dir.chdir app.cache_path.join(source.class.type) do + cache_path = app.cache_path.join(source.class.type) + next unless File.exist?(cache_path) + Dir.chdir cache_path do # licensed v1 cached records were stored as .txt files with YAML frontmatter Dir["**/*.txt"].each do |file| yaml, licenses, notices = parse_file(file)