Rakefile in wcc-contentful-app-1.2.0 vs Rakefile in wcc-contentful-app-1.2.1
- old
+ new
@@ -3,26 +3,26 @@
require 'bundler/setup'
require 'fileutils'
require 'wcc/contentful'
-# rubocop:disable Metrics/LineLength
+# rubocop:disable Layout/LineLength
# Disabling line length for contentful-schema-diff backtick execution
namespace :app do
desc "Imports a set of models from a space as a single template for the ModelGenerator.\n" \
- 'Usage: rake wcc:import_model[content-type-id,space-id?,extra-content-type-1,extra-content-type-2...]'
+ 'Usage: rake wcc:import_model[content-type-id,space-id?,extra-content-type-1,extra-content-type-2...]'
task :import_model, [:model, :space] do |_t, args|
raise ArgumentError, 'Must give a content type' unless model = args[:model]
singular = model.downcase.singularize
plural = model.downcase.pluralize
all_models = [model, *args.extras]
unless space = args[:space].presence
- space = ENV['CONTENTFUL_SPACE_ID']
+ space = ENV.fetch('CONTENTFUL_SPACE_ID', nil)
space = "#{space}/#{ENV['CONTENTFUL_ENVIRONMENT']}" if ENV['CONTENTFUL_ENVIRONMENT']
end
raise ArgumentError, 'Must provide a space' unless space
unless mgmt_token = ENV['CONTENTFUL_MANAGEMENT_TOKEN']
raise ArgumentError, 'Must set CONTENTFUL_MANAGEMENT_TOKEN envvar'
@@ -116,10 +116,10 @@
end
HEREDOC
end
end
-# rubocop:enable Metrics/LineLength
+# rubocop:enable Layout/LineLength
task :release do
raise StandardError, 'Please run rake release only from the root folder.'
end