Sha256: 299ff70d07aa1300b730b6d74aff45290e2d426f9ccfb36fcf323e1302182220

Contents?: true

Size: 1.25 KB

Versions: 7

Compression:

Stored size: 1.25 KB

Contents

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fwtoolkit-2.3.6 lib/fwtoolkit/cli/bitrise.rb
fwtoolkit-2.3.5 lib/fwtoolkit/cli/bitrise.rb
fwtoolkit-2.3.4 lib/fwtoolkit/cli/bitrise.rb
fwtoolkit-2.3.3 lib/fwtoolkit/cli/bitrise.rb
fwtoolkit-2.3.2 lib/fwtoolkit/cli/bitrise.rb
fwtoolkit-2.3.1 lib/fwtoolkit/cli/bitrise.rb
fwtoolkit-2.3.0 lib/fwtoolkit/cli/bitrise.rb