Skip to content

Commit

Permalink
Improve rails:template undefined LOCATION variable error message fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
raghunadhd committed Jul 23, 2011
1 parent ace3723 commit 9089575
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion railties/lib/rails/tasks/framework.rake
Expand Up @@ -2,9 +2,10 @@ namespace :rails do
desc "Update configs and some other initially generated files (or use just update:configs, update:scripts, or update:application_controller)"
task :update => [ "update:configs", "update:scripts", "update:application_controller" ]

desc "Applies the template supplied by LOCATION=/path/to/template"
desc "Applies the template supplied by LOCATION=(/path/to/template) or URL"
task :template do
template = ENV["LOCATION"]
raise "No LOCATION value given. Please set LOCATION either as path to a file or a URL" if template.blank?
template = File.expand_path(template) if template !~ %r{\A[A-Za-z][A-Za-z0-9+\-\.]*://}

require 'rails/generators'
Expand Down

0 comments on commit 9089575

Please sign in to comment.