multipull 0.0.1 → 0.0.4
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 +46 -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: 856b4c5e02bb5298fc6efb851bb844eece135e7bee48341f631f8d8a17958d02
|
4
|
+
data.tar.gz: 3836ec83f7a4ca566aa560179eaf93d1d9eb3ca1ad933c66421a74caf43bcd01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac920ccd6dafec05aadce61a4529c3d1ea89a3251ebf01be24b763a3da2c435aacaef4d23cc3bf5b6cb21bea0f0dd2c65c24f99d72868761a521f8b727a9077d
|
7
|
+
data.tar.gz: e4f9d2111542c94983691ee4c2becd3ad9c30ce35c5bff8defd8d8294bf1251bfbaaff98d1c577efa897d3a55b5d8e5a1e50180e310c09a5dc93df32bf76ecb0
|
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 "multipull #{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,40 @@ module Multipull
|
|
49
56
|
puts magenta("#{dir} is not a directory")
|
50
57
|
next
|
51
58
|
end
|
59
|
+
|
60
|
+
skipped = []
|
61
|
+
succeeded = []
|
62
|
+
failed = []
|
52
63
|
Dir.chdir(dir) do
|
53
64
|
Dir.glob('*/').each do |subdir|
|
54
|
-
puts blue(bold(subdir))
|
55
65
|
Dir.chdir(subdir) do
|
56
|
-
|
66
|
+
dirname = subdir.delete_suffix('/')
|
67
|
+
if File.directory?('.git')
|
68
|
+
puts blue(bold(dirname))
|
69
|
+
else
|
70
|
+
skipped << dirname
|
71
|
+
next
|
72
|
+
end
|
73
|
+
if system("git pull #{@git_opts.join(' ')}")
|
74
|
+
succeeded << dirname
|
75
|
+
else
|
76
|
+
failed << dirname
|
77
|
+
end
|
57
78
|
end
|
58
79
|
end
|
59
80
|
end
|
81
|
+
unless skipped.empty?
|
82
|
+
warn \
|
83
|
+
bold('Skipped : ') + skipped.join(' ')
|
84
|
+
end
|
85
|
+
unless succeeded.empty?
|
86
|
+
warn \
|
87
|
+
bold(green('Succeeded : ')) + succeeded.join(' ')
|
88
|
+
end
|
89
|
+
unless failed.empty?
|
90
|
+
warn \
|
91
|
+
bold(magenta('Failed : ')) + failed.join(' ')
|
92
|
+
end
|
60
93
|
end
|
61
94
|
end
|
62
95
|
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.4
|
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-
|
11
|
+
date: 2022-08-01 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: []
|