Browse files

Improve rails:template undefined LOCATION variable error message fixed

  • Loading branch information...
1 parent ace3723 commit 90895758f418315b04f871341e6028a08fa51694 @raghunadhd raghunadhd committed Jul 23, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 railties/lib/rails/tasks/framework.rake
View
3 railties/lib/rails/tasks/framework.rake
@@ -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'

0 comments on commit 9089575

Please sign in to comment.