#!/usr/bin/env ruby require 'rubygems' require 'zena/info' if %w(--version -v).include? ARGV.first puts "zena #{Zena::VERSION}" exit(0) end if ARGV.first == 'init' exec "rake zena:init RAILS_ENV=#{ARGV[1] || 'production'}" end require 'rails/version' require 'rails_generator' require 'rails_generator/scripts/generate' template_path = File.join(Zena::ROOT, 'lib', 'zena', 'deploy', 'template.rb') args = ["-m", template_path] args << ARGV.first puts "Generating zena application from template #{template_path}" Rails::Generator::Base.use_application_sources! Rails::Generator::Scripts::Generate.new.run( args, :generator => 'app' )