lib/robotkit/cli.rb in robotkit-0.1.3 vs lib/robotkit/cli.rb in robotkit-0.1.4

- old
+ new

@@ -4,27 +4,27 @@ require "erb" module Robotkit PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__))) class CLI < Thor - desc "create :project_name --package com.github.library", "Create Android project" + desc "create :output_dir", "Create Android library project." option :package, required: true option :library_module option :sample_module option :fixtures_dir - def create(project_name) - puts project_name - Robotkit.exec(options.merge({output_dir: project_name})) + def create(output_dir) + puts output_dir + Robotkit.exec(options.merge({output_dir: output_dir})) end end def self.exec(params) - sample_package_name = "#{params[:package]}.sample" + fixtures_dir = params[:fixtures_dir] || File.join(PROJECT_ROOT_PATH, "fixtures") + output_dir = params[:output_dir] library_package_name = params[:package] + sample_package_name = "#{params[:package]}.sample" library_module = params[:library_module] || "library" sample_module = params[:sample_module] || "sample" - fixtures_dir = params[:fixtures_dir] || File.join(PROJECT_ROOT_PATH, "fixtures") - output_dir = params[:output_dir] # copy from fixtues dir to output dir FileUtils.mkdir(output_dir) Dir.foreach(fixtures_dir).reject{|it| it.start_with?(".")}.each do |item| FileUtils.rm("#{output_dir}/#{item}", {force: true})