Skip to content

Instantly share code, notes, and snippets.

@zamith
Created July 13, 2015 19:05
Embed
What would you like to do?
def install
unless Dir.exists?(target_dir)
repo_url = if @use_ssh
"git@github.com:#{@author}/#{@repository}.git"
else
"git://github.com/#{@author}/#{@repository}.git"
end
exec "git clone#{@branch} #{repo_url} #{target_dir}"
end
exec "ln -sf ../#{target_dir}/src libs/#{name}"
if File.exists?("#{target_dir}/Projectfile")
project = Crystal::Project.new
project.eval do
File.read_lines("#{target_dir}/Projectfile")
end
project.install_deps
end
if @locked_version
if current_version != @locked_version
exec "git -C #{target_dir} checkout -q #{@locked_version}"
end
else
@locked_version = current_version
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment