tworingtools 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/sync-forks +7 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03e283802686ddec482dfa738d63a288146317b151a23ac375f4e29dcfa68e5b
|
4
|
+
data.tar.gz: 4944611322f47b1435b638b7c39d0809f869b1d73cf718f9b9e7f92203b3baf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da70cf856c13914d7d220f9bacf3829548dc2db82e4a6f464e243f8f8bbfcdca5d67fe33d3ad0ca9d28b859f88d8a4319bcfb0f6fc178c54c6d897888ade15d8
|
7
|
+
data.tar.gz: e2d273bcd615287e2fef46e172b91c403fb38e8ccca57ed9deedb66a19d5d6c2b4dcdb6e4df4b8a844b932e63c2111fb2e225d4bf18fb929e6f0cd4e9f164f20
|
data/bin/sync-forks
CHANGED
@@ -18,6 +18,7 @@ parser = OptionParser.new do |opts|
|
|
18
18
|
|
19
19
|
sync-forks -u/--username <user> -p/--password <pass> [-o/--one-time-pw <otp>] .
|
20
20
|
sync-forks -u/--username <user> -t/--token <token> .
|
21
|
+
sync-forks -u/--username <user> -t/--token -n/--repo-name that-one-repo-I-forked <token> .
|
21
22
|
|
22
23
|
If you already have a Personal Access Token, provide it in the second form.
|
23
24
|
Otherwise, use the first form, which will register a new token for you named
|
@@ -32,6 +33,7 @@ parser = OptionParser.new do |opts|
|
|
32
33
|
opts.on('-tTOKEN', '--token=TOKEN', 'GitHub personal access token. The primary way to use this program.') do |t| options[:token] = t end
|
33
34
|
opts.on('-pPASSWORD', '--password=PASSWORD', 'GitHub password.') do |pass| options[:password] = pass end
|
34
35
|
opts.on('-oOTP', '--one-time-pw=OTP', 'GitHub 2FA token, if you have it enabled.') do |otp| options[:otp] = otp end
|
36
|
+
opts.on('-rREPO', '--repo-name=REPO', 'The name of a particular repository to sync.') do |repo| options[:repo] = repo end
|
35
37
|
end
|
36
38
|
parser.parse!
|
37
39
|
|
@@ -60,6 +62,10 @@ end
|
|
60
62
|
repos = github.repos.list user: options[:username], auto_pagination: true
|
61
63
|
forks = repos.select {|x| x.fork}
|
62
64
|
|
65
|
+
if options[:repo] != nil then
|
66
|
+
forks.select! {|x| x.name == options[:repo]}
|
67
|
+
end
|
68
|
+
|
63
69
|
current_dir = Dir.new(ARGV[0])
|
64
70
|
Dir.chdir current_dir
|
65
71
|
forks.each do |forked|
|
@@ -74,7 +80,7 @@ forks.each do |forked|
|
|
74
80
|
else
|
75
81
|
echo_and_exec "git clone #{url}"
|
76
82
|
Dir.chdir "#{name}"
|
77
|
-
echo_and_exec "git remote add upstream #{fork_url}"
|
83
|
+
echo_and_exec "git remote add upstream #{fork_url} --mirror=fetch"
|
78
84
|
Dir.chdir ".."
|
79
85
|
end
|
80
86
|
end
|