cocoapods-hd 0.0.4 → 0.0.5

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: 4c26eaab0b2fc3b982d42378b155bb3b07d231a6ad39018c68fe97d81d443918
4
- data.tar.gz: 58836e38a2235e1d04dda6a4cb1007f65c33ca5af619823d7e5e84600b359471
3
+ metadata.gz: cbebbaf65a5ed84c38054190ce2122553d9b79b8068ff3b958d2747ad5542fd9
4
+ data.tar.gz: caad4f5c09f12847ac7909c20959f2e02a14abda509344b2bfae25432ecf81c3
5
5
  SHA512:
6
- metadata.gz: ebfb8aac3439aec8338846e227c0f1ed60a748bc3f8a3ceb8c5ca65fb8f15d733dec2dd827783f52c8931e3600a447f2fd45e14d98d2dd4c38186164148177cc
7
- data.tar.gz: b89c2a8c400f009fcc9566457585ceeabcdfacbce230dd7e6b20d0033f3326c7aaae41b88de2b04059a7b8b677cec3a837512006ea404943f573c5850a65f86d
6
+ metadata.gz: 37a96008fc62e0f5c3b8d087ebcac385882d0f928b82eee1f67e1df0349f1550f523654deab1096afc4ef1ecb73c41e17d53b22af1418d5290115f8bfa2dee0b
7
+ data.tar.gz: 349f7aca0788cb4f66e76a6c67a5dda2d13dc0672246be7d3a30fd4ed5e7c4e60252e26779867c869e40e82d41398718b08b9e73c4110344cd12d24faa33c0e2
@@ -72,14 +72,12 @@ module Pod
72
72
  `pod ipc spec #{pod_name}.podspec >>#{podspec_json_name}`
73
73
  podspec_json_dir = File.join(Dir.pwd, podspec_json_name)
74
74
 
75
- source_specs_dir = get_source_specs_dir
76
-
77
- UI.puts("HDSourceSpecs目录: #{source_specs_dir}")
75
+ UI.puts("HDSourceSpecs目录: #{get_source_specs_dir}")
78
76
 
79
- Dir.chdir(source_specs_dir)
77
+ Dir.chdir(get_source_specs_dir)
80
78
  `git pull`
81
79
 
82
- dest_dir = File.join(source_specs_dir, pod_name, get_tag)
80
+ dest_dir = File.join(get_source_specs_dir, pod_name, get_tag)
83
81
 
84
82
  UI.section("创建目录: #{dest_dir}") do
85
83
  FileUtils.mkdir_p(dest_dir) unless File.directory?(dest_dir)
@@ -90,18 +88,12 @@ module Pod
90
88
  end
91
89
 
92
90
  UI.section("✅ #{podspec_json_name} 上传成功") do
93
- `git status -s`
94
- `git add .`
95
- `git commit -m 'add #{pod_name} #{get_tag}'`
96
- `git push origin master`
91
+ TagUtil.upload_origin_sources("添加 #{pod_name}/#{get_tag}")
97
92
  end
98
-
99
93
  Dir.chdir(module_dir)
100
94
  end
101
- unless exist_cocoapods_source_dir
102
- module_parent_dir = File.expand_path("..", Dir.pwd) # ~/debug-cocoapods-hd
103
- source_repo_path = File.join(module_parent_dir, "HDSourceSpecs")
104
- FileUtils.rm_r(source_repo_path)
95
+ unless File.directory?(cocoapods_repos_dir)
96
+ remove_git_source_repo
105
97
  end
106
98
 
107
99
  unless @beta
@@ -111,7 +103,6 @@ module Pod
111
103
  delete_tag(beta_tag)
112
104
  end
113
105
  end
114
-
115
106
  end
116
107
  end
117
108
 
@@ -136,6 +127,7 @@ module Pod
136
127
 
137
128
  # 移除tag
138
129
  def delete_tag(tag)
130
+
139
131
  UI.puts "🍉 开始删除tag: #{tag}"
140
132
  if TagUtil.exist_tag(tag)
141
133
  TagUtil.git_delete_tag(tag)
@@ -157,25 +149,19 @@ module Pod
157
149
  pod_name = rip.to_s.gsub(".podspec", "")
158
150
  UI.puts "pod_name: #{pod_name}"
159
151
 
160
- unless File.directory?(cocoapods_repos_dir)
161
- Pod::UI.puts "本地 HDSourceSpecs not found"
162
- break
163
- end
152
+ source_specs_dir = get_source_specs_dir
164
153
 
165
- full_path = File.join(cocoapods_repos_dir, pod_name, tag_name)
154
+ pod_tag_path = File.join(source_specs_dir, pod_name, tag_name)
166
155
 
167
- unless File.exist?(full_path)
156
+ unless File.exist?(pod_tag_path)
168
157
  UI.warn "❌ 本地HDSourceSpecs不包含#{pod_name}的#{tag_name}标签, 请先执行 pod repo update"
158
+ remove_git_source_repo
169
159
  break
170
160
  end
171
- FileUtils.remove_dir(full_path)
172
- Dir.chdir(cocoapods_repos_dir)
173
- # UI.puts "切换到:#{Dir.pwd}"
161
+ FileUtils.remove_dir(pod_tag_path)
162
+ Dir.chdir(source_specs_dir)
174
163
  UI.section("✅ #{pod_name} #{tag_name} 标签删除成功 !!!") do
175
- `git pull origin master`
176
- `git add .`
177
- `git commit -m '删除#{pod_name}/#{tag_name}'`
178
- `git push origin master`
164
+ TagUtil.upload_origin_sources("删除 #{pod_name}/#{tag_name}")
179
165
  end
180
166
 
181
167
  end
@@ -185,8 +171,9 @@ module Pod
185
171
  File.join(Dir.home, ".cocoapods/repos/HDSourceSpecs")
186
172
  end
187
173
 
188
- def exist_cocoapods_source_dir
189
- File.directory?(cocoapods_repos_dir)
174
+ def remove_git_source_repo
175
+ source_repo_path = File.join(File.dirname(Dir.pwd), "HDSourceSpecs")
176
+ FileUtils.rm_r(source_repo_path)
190
177
  end
191
178
 
192
179
  def run
@@ -1,3 +1,3 @@
1
1
  module CocoapodsHd
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -29,6 +29,14 @@ module Pod
29
29
  false
30
30
  end
31
31
 
32
+ # 上传Sources
33
+ def self.upload_origin_sources(commit_desc)
34
+ `git status -s`
35
+ `git add .`
36
+ `git commit -m '#{commit_desc}'`
37
+ `git push origin master`
38
+ end
39
+
32
40
  def self.check_branch_include_tag(tag)
33
41
  branch_name = `git symbolic-ref --short -q HEAD`
34
42
  if branch_name.to_s.strip == "master"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-hd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - xingyong