Skip to content

Instantly share code, notes, and snippets.

@brynbellomy
Created September 12, 2012 14:09
Show Gist options
  • Select an option

  • Save brynbellomy/3706851 to your computer and use it in GitHub Desktop.

Select an option

Save brynbellomy/3706851 to your computer and use it in GitHub Desktop.
a Rakefile for building CoffeeScript cli utils
task :default => [ :uninstall, :clean, :build, :install ]
file "objc-autodoc" do |t|
sh "coffee --compile objc-autodoc.coffee"
sh "echo '#!/usr/bin/env node
' > ./objc-autodoc"
sh "cat ./objc-autodoc.js >> ./objc-autodoc"
sh "chmod +x ./objc-autodoc"
end
file "/usr/local/bin/objc-autodoc" => ["objc-autodoc"] do |t|
sh "ln -s objc-autodoc /usr/local/bin/objc-autodoc"
end
task :build => [ "objc-autodoc" ]
task :install => [ "/usr/local/bin/objc-autodoc" ]
task :clean => [ :uninstall ] do |t|
if File.exist?("./objc-autodoc")
sh "rm ./objc-autodoc"
end
end
task :uninstall do |t|
if File.symlink?("/usr/local/bin/objc-autodoc")
sh "rm /usr/local/bin/objc-autodoc"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment