def install_version!(version, install_path)
if environment.local? && !vendored?(name, version)
raise Error, "Could not find a local copy of #{name} at #{version}."
end
if environment.vendor?
vendor_cache(name, version) unless vendored?(name, version)
end
cache_version_unpacked! version
if install_path.exist? && rsync? != true
install_path.rmtree
end
unpacked_path = version_unpacked_cache_path(version).join(module_name(name))
unless unpacked_path.exist?
raise Error, "#{unpacked_path} does not exist, something went wrong. Try removing it manually"
else
cp_r(unpacked_path, install_path)
end
end