diff --git a/lib/tasks/locomotive.rake b/lib/tasks/locomotive.rake index a36f5a70..2182ec2c 100644 --- a/lib/tasks/locomotive.rake +++ b/lib/tasks/locomotive.rake @@ -31,7 +31,7 @@ namespace :locomotive do desc 'Import a remote template described by its URL -- 2 options: SITE=name or id, RESET=by default false' task :import => :environment do - url, site_name_or_id, reset = ENV['URL'], ENV['SITE'], Boolean.set(ENV['RESET']) || false + url, site_name_or_id, samples, reset = ENV['URL'], ENV['SITE'], (Boolean.set(ENV['SAMPLES']) || false), (Boolean.set(ENV['RESET']) || false) if url.blank? || (url =~ /https?:\/\//).nil? raise "URL is missing or it is not a valid http url." @@ -43,9 +43,10 @@ namespace :locomotive do raise "No site found. Please give a correct value (name or id) for the SITE env variable." end - ::Locomotive::Import::Job.run!(url, site, { :samples => true, :reset => reset }) + ::Locomotive::Import::Job.run!(url, site, { :samples => samples, :reset => reset }) end + desc 'Add a new admin user (NOTE: currently only supports adding user to first site)' task :add_admin => :environment do name = ask('Display name: ') { |q| q.echo = true }