gct 0.1.9 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c06014224ab0efd5c15476793d97d566c7089bbc11b52a5aed2550c30655e8b7
4
- data.tar.gz: 3d58f23f04cbf4a618dc8a9810fa4a49d3e41078fe8b0ce84d06181e1fbd69ce
3
+ metadata.gz: 437c189b8e27e16906f14ad43679cbc4f1dfe6ed507c91672f8fd297e53afbc7
4
+ data.tar.gz: ca539bc87c71bb641446e3e4208b0c5db6b343fc0ca3aa6cf1b71d1d16b58d77
5
5
  SHA512:
6
- metadata.gz: a43586d042e87cf2ee7640c902f84a1e64caa9a3779a50dfcde6094f0fbfecb57da288de2ebd28dbd90a0f1ebea9bf87482457bb6b31eae1b6ab3d63f5c663e9
7
- data.tar.gz: 7115bddc78ff2a5c9b74610c5c3b3a0b6e17dd486f9dcadd8ae46ee1643b8ce4cf7bb8fabe1f01d19e1ede541acbe6eda6ec789e43a9d243520cda10b20b74c2
6
+ metadata.gz: 15c37f850c4de024fbdbc0aeffcfdd837f4043685d98a14e583c439ba2e60d272534f13d352c72bfb23278857d9a92dbc00c0efbae70326bef2166372abb6ecc
7
+ data.tar.gz: 8ef271d4d05f8d9674c0eef90e7eac8620e00c689a887587434865e54e31b6e5fbe1b8e2f67673f3f26b01675034457a814b15e43f3e799b209b5563ece85ee6
@@ -13,6 +13,10 @@ module Gct
13
13
  CLAide::Argument.new('BRANCH', false),
14
14
  ]
15
15
 
16
+ def self.options
17
+ [].concat(super)
18
+ end
19
+
16
20
  def initialize(argv)
17
21
  @url = argv.shift_argument
18
22
  @branch = argv.shift_argument
@@ -40,6 +44,7 @@ module Gct
40
44
  puts "#{dir}文件夹已存在!".red
41
45
  else
42
46
  branch = @branch.to_s.empty? ? '' : "-b #{@branch}"
47
+ push_branch = @branch.to_s.empty? ? "master" : "#{@branch}"
43
48
  `git clone #{branch} #{@url}`
44
49
  puts "git命令为:<-- git clone #{branch} #{@url} -->".green
45
50
  Dir.chdir(path) do
@@ -48,7 +53,7 @@ module Gct
48
53
  `git remote set-url origin #{git_url}.git`
49
54
  `git add .`
50
55
  `git commit -m "First commit"`
51
- `git push -u origin master`
56
+ `git push origin #{push_branch}`
52
57
  `git push --tags`
53
58
  # TODO 将podspec上传到私有specs上
54
59
 
data/lib/gct/version.rb CHANGED
@@ -2,5 +2,5 @@ module Gct
2
2
  # freeze 冻结对象,将对象变成一个常量
3
3
  # unless 右边的代码块成立,才会运行左边的代码块
4
4
  # defined? 是用来判断本地变量是否存在,也可用来判断是否存在方法
5
- VERSION = "0.1.9".freeze unless defined? Gct::VERSION
5
+ VERSION = "0.2.0".freeze unless defined? Gct::VERSION
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jieming