#!/usr/bin/env ruby
require 'rubygems'
require 'yaml'
require 'fileutils'
include FileUtils
puts File.dirname(__FILE__)

if File.exists? "build.yml"
  $app_config = YAML::load_file("build.yml")

  unless $app_config["sdk"].nil?
    $app_config["sdk"] = nil

    File.open(  'build.yml', 'w' ) do |out|
      YAML.dump( $app_config, out )
    end

    rakefilepath = File.join( `get-rhodes-info --rhodes-path`.chomp(), 'res/generators/templates/application/Rakefile' )
    puts "Application Rakefile has been updated to use latest Rhodes gem."
    cp rakefilepath, '.'
  end
end
