tworingtools 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/sync-forks +7 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad387ba8fcbbe72b5eeffdb373c89a19dee200d44f610e00bf7c0e5b51b587a5
4
- data.tar.gz: f2380c00edb582a8aba33c3815c7a137c130064e93758e1e92fb5f9786ed947f
3
+ metadata.gz: 03e283802686ddec482dfa738d63a288146317b151a23ac375f4e29dcfa68e5b
4
+ data.tar.gz: 4944611322f47b1435b638b7c39d0809f869b1d73cf718f9b9e7f92203b3baf8
5
5
  SHA512:
6
- metadata.gz: 99e295a3a79464f0fb905467f8ba853f7e8ca2b794cf1a668787feae2c740537358f0d5154545d4441f28af175837b945ba3ed3b5cb90e6a28ca2d54d0d78bd7
7
- data.tar.gz: fa2c324a3389b6ba87808e2dbce6272bd2fab4335fac6ab56b1a4f50eecf98d51f8933effee2d37da3c293249de1f29860d1a73a98881dba6977228452733dcd
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tworingtools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew McKnight