Skip to content

Instantly share code, notes, and snippets.

@bostonaholic
Created February 10, 2011 02:48
Show Gist options
  • Save bostonaholic/819825 to your computer and use it in GitHub Desktop.
Save bostonaholic/819825 to your computer and use it in GitHub Desktop.
Rakefile for installing leiningen on OSX
require 'rake'
task :default => [:lein]
desc "download leiningen script and create symbolic link to /usr/local/bin/lein"
task :lein do
leiningen
end
def curl_leiningen(source_file)
`curl -OL https://github.com/technomancy/leiningen/raw/stable/bin/lein > #{source_file}`
end
def leiningen
current_dir = File.dirname(__FILE__)
source_file = File.join(current_dir, 'lein')
curl_leiningen(source_file)
`chmod +x lein`
target_file = File.join(File.expand_path('/usr/local/bin/'), 'lein')
`sudo ln -s -Ff #{source_file} #{target_file}`
end
@bostonaholic
Copy link
Author

Install

rake

or

rake lein

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment