require 'thor' require 'fileutils' require 'fwtoolkit/config' require 'fwtoolkit/projectfile' require 'fwtoolkit/cli/fw_actions' require 'fwtoolkit/cli/thorutils' module FWToolkit class Bitrise < Thor include Thor::Actions include FWToolkit::ThorUtils source_root_templates! desc 'genereate [PROJECT NAME]', "Create a new bitrise.yml file for the project, based on a blank file" def generate(project_name) destination_root = Dir.pwd say "Creating bitrise.yml file in: #{File.expand_path destination_root}/bitrise.yml" invoke FWToolkit::Bitrise, 'new', [destination_root, project_name] end desc 'new', 'Creates a new bitrise YML configuration file' def new(project_root, project_name) destination_root = project_root bitrise_file = File.join(project_root, 'bitrise.yml') Projectfile.load_with_config! :project_name => project_name template_config = { :target_platform => Config.target_platform, :organization_name => Config.organization_name, :project_creator => Config.developer_name } template_config.merge! Projectfile.config template_directory "templates/bitrise", destination_root, template_config end end end