Skip to content

Instantly share code, notes, and snippets.

@danbernier
Forked from sukima/Rakefile
Created April 18, 2013 20:16
Show Gist options
  • Save danbernier/5415883 to your computer and use it in GitHub Desktop.
Save danbernier/5415883 to your computer and use it in GitHub Desktop.
def missing(message)
if message.is_a? Symbol
puts "The environment is missing #{message.to_s.upcase}"
else
puts message
end
end
desc "Check the environment for proper setup"
task :checkenv do
env_is_ok = true
if ENV["PATH"].index("environment-manager/common/bin").nil?
missing "PATH is missing environment-manager/common/bin"
env_is_ok = false
end
[ :titanium_root, :android_sdk_path, :android_tools, :google_drive ].each do |variable|
str = variable.to_s.upcase
if not ENV[str] or ENV[str].empty?
missing variable
env_is_ok = false
end
end
abort "Environment is not ready. See above." unless env_is_ok
end
desc "foobar"
task :default => :checkenv do
puts "Word! Yo!"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment