Sha256: b92c3d2381a41ae9af67e56dc7e0b99b8dd2d2266444bcab3e0dcdd03a71a4da
Contents?: true
Size: 1.01 KB
Versions: 128
Compression:
Stored size: 1.01 KB
Contents
require 'lhj/config' require 'highline' require 'lhj/helper/pod_repo_config' module Lhj class Command # sync code to pod class SyncPodCode < Command self.summary = '同步代码到目标目录' def initialize(argv) @cli = HighLine.new super end def begin_title '读取映射文件~/.lhj/pod_config.yml' end def handle sync end def sync config_file = File.join(Lhj::Config.instance.home_dir, 'pod_config.yml') arr = YAML.load_file(config_file) arr.each_index { |i| puts "#{i}.#{arr[i]['pod']}".yellow } idx = @cli.ask('请选择哪一个库同步: '.green).strip.to_i src = arr[idx]['main_path'] dest = arr[idx]['pod_path'] FileUtils.cp_r(src, dest, remove_destination: true) puts '1.从主工程复制代码到pod库成功'.green Dir.chdir(dest) do Actions.sh('git add .') puts '2.git add成功'.green end end end end end
Version data entries
128 entries across 128 versions & 1 rubygems