multipull 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/multipull/command.rb +30 -13
- data/lib/multipull/terminal_color.rb +4 -0
- data/lib/multipull/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebfa0a655ff29ebdefed299f27fc87a0826bde332aef7c4d1317af16df996b1f
|
4
|
+
data.tar.gz: bb175cd6e2f4d7f7bf5eac3ee5b2c92f848d8451005cfe173e9b6145c0a522e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b01599cad75d41f2f64f706ea2e35c594d964d62aad8879b895d93bb3950b54e3fa2df08cc5d4f423e9a592d2b1ac1c80d995abe5a74941fa908a63eeb34dedf
|
7
|
+
data.tar.gz: 4560a68c1ed27422ede1dee6c1faa18da618768529112945f8e3d10115ab516f6295f95fe8ba4a7fa6671c80f6c49c9dbe7aee69a1b8c111647947b33f5987c0
|
data/lib/multipull/command.rb
CHANGED
@@ -10,6 +10,7 @@ module Multipull
|
|
10
10
|
def initialize
|
11
11
|
# @options = {}
|
12
12
|
@dirs = []
|
13
|
+
@git_opts = []
|
13
14
|
end
|
14
15
|
|
15
16
|
def run
|
@@ -20,19 +21,25 @@ module Multipull
|
|
20
21
|
private
|
21
22
|
|
22
23
|
def parse_options
|
23
|
-
OptionParser.new
|
24
|
-
|
24
|
+
opts = OptionParser.new
|
25
|
+
opts.banner = 'Usage: multipull [options] [dir...]'
|
25
26
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
opts.on('--version', 'Show version') do
|
28
|
+
puts VERSION
|
29
|
+
exit
|
30
|
+
end
|
30
31
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
opts.on('--help', 'Show help') do
|
33
|
+
puts opts
|
34
|
+
exit
|
35
|
+
end
|
36
|
+
|
37
|
+
begin
|
38
|
+
opts.parse!
|
39
|
+
rescue OptionParser::InvalidOption => e
|
40
|
+
@git_opts += e.args
|
41
|
+
retry
|
42
|
+
end
|
36
43
|
|
37
44
|
@dirs = ARGV.empty? ? ['.'] : ARGV
|
38
45
|
end
|
@@ -49,14 +56,24 @@ module Multipull
|
|
49
56
|
puts magenta("#{dir} is not a directory")
|
50
57
|
next
|
51
58
|
end
|
59
|
+
|
60
|
+
succeeded = []
|
61
|
+
failed = []
|
52
62
|
Dir.chdir(dir) do
|
53
63
|
Dir.glob('*/').each do |subdir|
|
54
|
-
puts blue(bold(subdir))
|
55
64
|
Dir.chdir(subdir) do
|
56
|
-
|
65
|
+
dirname = subdir.delete_suffix('/')
|
66
|
+
puts blue(bold(dirname))
|
67
|
+
if system("git pull #{@git_opts.join(' ')}")
|
68
|
+
succeeded << dirname
|
69
|
+
else
|
70
|
+
failed << dirname
|
71
|
+
end
|
57
72
|
end
|
58
73
|
end
|
59
74
|
end
|
75
|
+
warn bold(green('Succeeded : ')) + succeeded.join(' ')
|
76
|
+
warn bold(magenta('Failed : ')) + failed.join(' ')
|
60
77
|
end
|
61
78
|
end
|
62
79
|
end
|
data/lib/multipull/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multipull
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kojix2
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Git pull multiple repositories at once
|
14
14
|
email:
|
@@ -28,7 +28,7 @@ homepage: https://github.com/kojix2/multipull
|
|
28
28
|
licenses:
|
29
29
|
- MIT
|
30
30
|
metadata: {}
|
31
|
-
post_install_message:
|
31
|
+
post_install_message:
|
32
32
|
rdoc_options: []
|
33
33
|
require_paths:
|
34
34
|
- lib
|
@@ -44,7 +44,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
44
44
|
version: '0'
|
45
45
|
requirements: []
|
46
46
|
rubygems_version: 3.3.7
|
47
|
-
signing_key:
|
47
|
+
signing_key:
|
48
48
|
specification_version: 4
|
49
49
|
summary: Git pull multiple repositories at once
|
50
50
|
test_files: []
|