Skip to content

Instantly share code, notes, and snippets.

@zamith
Created July 13, 2015 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zamith/df36464f5712032e6881 to your computer and use it in GitHub Desktop.
Save zamith/df36464f5712032e6881 to your computer and use it in GitHub Desktop.
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