Created
September 12, 2012 14:09
-
-
Save brynbellomy/3706851 to your computer and use it in GitHub Desktop.
a Rakefile for building CoffeeScript cli utils
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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