File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -66,17 +66,23 @@ module Shards
66
66
# link the project's lib path as the shard's lib path, so the dependency
67
67
# can access transitive dependencies:
68
68
unless resolver.is_a?(PathResolver )
69
- lib_path = File .join(install_path, Shards ::INSTALL_DIR )
70
- Log .debug { " Link #{ Shards .install_path} to #{ lib_path } " }
71
- Dir .mkdir_p(File .dirname(lib_path))
72
- target = File .join(Path .new(Shards ::INSTALL_DIR ).parts.map { " .." })
73
- File .symlink(target, lib_path)
69
+ install_lib_path
74
70
end
75
71
76
72
Shards .info.installed[name] = self
77
73
Shards .info.save
78
74
end
79
75
76
+ private def install_lib_path
77
+ lib_path = File .join(install_path, Shards ::INSTALL_DIR )
78
+ return if File .exists?(lib_path)
79
+
80
+ Log .debug { " Link #{ Shards .install_path} to #{ lib_path } " }
81
+ Dir .mkdir_p(File .dirname(lib_path))
82
+ target = File .join(Path .new(Shards ::INSTALL_DIR ).parts.map { " .." })
83
+ File .symlink(target, lib_path)
84
+ end
85
+
80
86
protected def cleanup_install_directory
81
87
Log .debug { " rm -rf #{ Process .quote(install_path)} " }
82
88
Shards ::Helpers .rm_rf(install_path)
You can’t perform that action at this time.
0 commit comments