Skip to content

Commit 352a161

Browse files
committed
Validate local collection symlink targets
1 parent 5de6ecd commit 352a161

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/rbs/collection/config/lockfile.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ def check_rbs_availability!
8282
raise CollectionNotAvailable unless meta_path.exist?
8383
raise CollectionNotAvailable unless library_data(gem) == YAML.load(meta_path.read)
8484
when Sources::Local
85-
raise CollectionNotAvailable unless fullpath.join(gem[:name], gem[:version]).symlink?
85+
installed_path = fullpath.join(gem[:name], gem[:version])
86+
source_path = source.full_path.join(gem[:name], gem[:version])
87+
raise CollectionNotAvailable unless installed_path.symlink? && File.identical?(installed_path, source_path)
8688
end
8789
end
8890
end

0 commit comments

Comments
 (0)