cocoapods-hbh 0.1.8 → 0.1.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bad5c1b8ce197c38234be5e45fbd18308cae43d59cf347945d0ebec29c5fdbe
|
4
|
+
data.tar.gz: 5ee039ad7e1c47dc8965d444f03290e4f069bb34ca48ac3de7c8f1ed97bd91fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75b416f95ddf8bcf7078f0e82b445d06d32a962a5d627667ba965d7d999ef2def5143b192ee723f090195c76fec228cbf47df076be11aa3d779bee4cdd15955e
|
7
|
+
data.tar.gz: 66e6b44209cd8a26c27fd59b6ccbaf41e5b056ca4972512d770ab24ce4a9f783719fc51a98c7c417cf124b8d04c76b24be929065e06f8aeee40bad20390ba3a9
|
@@ -83,12 +83,12 @@ module Pod
|
|
83
83
|
end
|
84
84
|
end
|
85
85
|
if moduleTag != nil and !moduleTag.empty?
|
86
|
-
result = system("cd #{path_module} && git fetch && git checkout #{moduleTag}")
|
86
|
+
result = system("cd #{path_module} && git fetch origin #{moduleTag} && git checkout #{moduleTag}")
|
87
87
|
raise "发生错误" unless result
|
88
88
|
# `cd #{path_module} && git fetch && git checkout #{moduleTag}`
|
89
89
|
# Pod::UI.puts "发生错误#{result}".red
|
90
90
|
else
|
91
|
-
result = system("cd #{path_module} && git fetch && git checkout #{moduleBranch} && git pull origin #{moduleBranch}")
|
91
|
+
result = system("cd #{path_module} && git fetch origin #{moduleBranch} && git checkout #{moduleBranch} && git pull origin #{moduleBranch}")
|
92
92
|
raise "发生错误" unless result
|
93
93
|
|
94
94
|
# Pod::UI.puts "发生错误#{result}".red
|
@@ -19,8 +19,17 @@ module Pod
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
+
def findGitPath
|
23
|
+
_git_path = ".git"
|
24
|
+
if !File.directory?(_git_path)
|
25
|
+
_git_path = "../.git"
|
26
|
+
end
|
27
|
+
_git_path
|
28
|
+
end
|
29
|
+
|
22
30
|
def copyFileToGit (file_name)
|
23
|
-
|
31
|
+
git_path = findGitPath()
|
32
|
+
if !File.directory?(git_path)
|
24
33
|
Pod::UI.puts "没有发现git工程"
|
25
34
|
return
|
26
35
|
end
|
@@ -28,44 +37,54 @@ module Pod
|
|
28
37
|
# 在当前ruby项目的githook文件copy到项目里去做拦截
|
29
38
|
# 如果项目里配置了 .git-hooks 文件件,将把里面的内容copy到项目里去做拦截
|
30
39
|
# 项目里的.git-hooks 配置优先
|
31
|
-
|
40
|
+
hooks_path = "#{File.dirname(__FILE__)}/../../script_source/#{file_name}"
|
32
41
|
|
33
|
-
if !File.exist?(
|
42
|
+
if !File.exist?(hooks_path)
|
34
43
|
Pod::UI.puts "同步文件不存在"
|
35
44
|
return
|
36
45
|
end
|
46
|
+
git_hooks_path = "#{git_path}/hooks"
|
47
|
+
if !File.exist?(git_hooks_path)
|
48
|
+
FileUtils.mkdir_p git_hooks_path
|
49
|
+
end
|
50
|
+
FileUtils.cp_r(hooks_path, git_hooks_path)
|
51
|
+
FileUtils.chmod("+x", "#{git_hooks_path}/#{file_name}")
|
52
|
+
findSubmodulesHooks(hooks_path, git_path, file_name)
|
53
|
+
end
|
37
54
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
FileUtils.
|
55
|
+
def findSubmodulesHooks (git_hooks_path, git_path, file_name)
|
56
|
+
subGitHookPath = walk(git_path)
|
57
|
+
subGitHookPath.each do |path|
|
58
|
+
FileUtils.cp_r(git_hooks_path, path)
|
59
|
+
FileUtils.chmod("+x", "#{path}/#{file_name}")
|
42
60
|
end
|
43
|
-
|
61
|
+
end
|
44
62
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
63
|
+
def walk (startPath, dirName = "hooks", first = true)
|
64
|
+
@pathArr=Array.new unless !first
|
65
|
+
Dir.foreach(startPath) do |x|
|
66
|
+
path = File.join(startPath, x)
|
67
|
+
if x =="." or x ==".."
|
68
|
+
next
|
69
|
+
elsif File.directory?(path)
|
70
|
+
if path.include?(dirName)
|
71
|
+
@pathArr << path
|
72
|
+
end
|
73
|
+
walk(path, dirName, false)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
@pathArr
|
55
77
|
end
|
56
78
|
|
57
79
|
def deleteFileInGit (file_name)
|
58
|
-
if !File.directory?(
|
80
|
+
if !File.directory?(findGitPath())
|
59
81
|
Pod::UI.puts "没有发现git工程"
|
60
82
|
return
|
61
83
|
end
|
62
|
-
|
63
84
|
path = ".git/hooks/#{file_name}"
|
64
85
|
if File.exist?(path)
|
65
86
|
FileUtils.rm(path)
|
66
87
|
end
|
67
|
-
|
68
|
-
|
69
88
|
end
|
70
89
|
end
|
71
90
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-hbh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zanju
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|