-
-
Save danbernier/5415883 to your computer and use it in GitHub Desktop.
This file contains 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
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