lib/rbs/collection/sources/git.rb in rbs-3.0.0.dev.2 vs lib/rbs/collection/sources/git.rb in rbs-3.0.0.dev.3

- old
+ new

@@ -43,22 +43,29 @@ def install(dest:, name:, version:, stdout:) setup!() gem_dir = dest.join(name, version) - if gem_dir.directory? + case + when gem_dir.symlink? + stdout.puts "Updating to #{format_config_entry(name, version)} from a local source" + gem_dir.unlink + _install(dest: dest, name: name, version: version) + when gem_dir.directory? prev = load_metadata(dir: gem_dir) if prev == metadata_content(name: name, version: version) stdout.puts "Using #{format_config_entry(name, version)}" else stdout.puts "Updating to #{format_config_entry(name, version)} from #{format_config_entry(prev["name"], prev["version"])}" FileUtils.remove_entry_secure(gem_dir.to_s) _install(dest: dest, name: name, version: version) end - else + when !gem_dir.exist? stdout.puts "Installing #{format_config_entry(name, version)}" _install(dest: dest, name: name, version: version) + else + raise end end def manifest_of(name, version) setup! do