Skip to content

Loading…

Improve rails:template undefined LOCATION variable error message fixed #2201

Closed
wants to merge 1 commit into from

2 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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'
Something went wrong with that request. Please try again.