tworingtools 5.0.0 → 6.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8a9c273d420e81312cd78a3cfb16705daa66c66cb88333b028a99aeead328b57
4
- data.tar.gz: bf970bd1d1613d2667f7d5279ec35c5d1bc0ea68b51d07d80bb4246491706320
3
+ metadata.gz: 4e106dbdd5ffeac3ac9461297fb97b4657447a2fa1dffd251018f0a167face95
4
+ data.tar.gz: b2f66ebcb62c823c22bafed9f3f443dcd9c0caeea2f2234b2d31de81453e5add
5
5
  SHA512:
6
- metadata.gz: e1acd45a72627aa1c61876360907b65715d55afe06c4c398d711476bc06e79baeb806475c1b46e739cecb57f5a13014273f423ff1d3b0d009987dc5e97143dfd
7
- data.tar.gz: 6160816443577623849b42d6cd0972b6314dc523bbcdc2295d9501c4d80f6bc1e124831f9aad4d61d27f81dcda68b8bae358869d50f1d4479d06aeedcbc1bb91
6
+ metadata.gz: 84a64f4e1edbcd3e44801794f5f4c8f528d77fff6c1c234d4855365097e4ebf59a0df8d3927ed7a508b60937e0c4dd321031a4929078e886266cd772e31df92e
7
+ data.tar.gz: d49e55978131717d3452a2eb7e6862120281bdd6b9ef4dd310b3eae62a97ac13a219377bf69b3661ba5a855b356a541c3f15f242ccd01d23d484eb432419f610
@@ -6,15 +6,11 @@ require 'optparse'
6
6
  require_relative '../lib/echoexec'
7
7
  require_relative '../lib/git_helpers'
8
8
 
9
- # failure modes
10
- FURTHER_REQUESTS_REQUIRE_TOKEN = 65
11
- MISSING_REQUIRED_CREDENTIALS = 66
12
-
13
9
  options = {}
14
10
  parser = OptionParser.new do |opts|
15
11
  opts.banner = <<~BANNER
16
12
 
17
- Usage: sync-git [options] <directory>
13
+ Usage: sync-git-remotes [options] <directory>
18
14
 
19
15
  For each of your GitHub forks, clone your forked version, then go in and add a remote
20
16
  to the upstream version, and set up local tracking branches for both remotes' default
@@ -23,25 +19,11 @@ parser = OptionParser.new do |opts|
23
19
  <directory> is the path containing the directories holding your forks, and/or
24
20
  to where those you don't yet have should be cloned.
25
21
 
26
- Examples:
27
-
28
- sync-git -u/--username <user> -p/--password <pass> [-o/--one-time-pw <otp>] .
29
- sync-git -u/--username <user> -t/--token <token> .
30
- sync-git -u/--username <user> -t/--token -n/--repo-name that-one-repo-I-forked <token> .
31
-
32
- If you already have a Personal Access Token, provide it in the second form.
33
- Otherwise, use the first form, which will register a new token for you named
34
- “sync-git”. Then use that to invoke the program again. This is because
35
- requests using basic authentication (user/pass) are too rate limited.
36
-
37
22
  Options:
38
23
 
39
24
  BANNER
40
25
 
41
- opts.on('-uUSERNAME', '--username=USERNAME', 'GitHub username. Required for all invocations.') do |user| options[:username] = user end
42
- opts.on('-tTOKEN', '--token=TOKEN', 'GitHub personal access token. The primary way to use this program.') do |t| options[:token] = t end
43
- opts.on('-pPASSWORD', '--password=PASSWORD', 'GitHub password.') do |pass| options[:password] = pass end
44
- opts.on('-oOTP', '--one-time-pw=OTP', 'GitHub 2FA token, if you have it enabled.') do |otp| options[:otp] = otp end
26
+ opts.on('-tTOKEN', '--token=TOKEN', 'GitHub personal access token.') do |t| options[:token] = t end
45
27
  opts.on('-rREPO', '--repo-name=REPO', 'The name of a particular repository to sync.') do |repo| options[:repo] = repo end
46
28
  opts.on('-v', '--verbose', 'Enable verbose logging.') do options[:verbose] = true end
47
29
  end
@@ -53,30 +35,6 @@ github = nil
53
35
  if nil != options[:token] then
54
36
  github = Octokit::Client.new(:access_token => options[:token])
55
37
  puts 'Running with provided token...'
56
- elsif nil != options[:username] && nil != options[:password]
57
- github = Octokit::Client.new \
58
- :login => options[:username],
59
- :password => options[:password]
60
-
61
- headers = Hash.new
62
- if nil != options[:otp] then
63
- headers['X-GitHub-OTP'] = options[:otp]
64
- end
65
-
66
- token = github.create_authorization \
67
- :scopes => ["user"],
68
- :note => "sync-git",
69
- :headers => headers
70
-
71
- puts "Created new token, use it to call sync-git again:"
72
- puts
73
- puts "\tsync-git -u #{user} -t #{token.token}"
74
- puts
75
- exit FURTHER_REQUESTS_REQUIRE_TOKEN
76
- else
77
- puts "Must provide either a username/token or username/password/otp combination to authenticate."
78
- puts parser
79
- exit MISSING_REQUIRED_CREDENTIALS
80
38
  end
81
39
 
82
40
  github.auto_paginate = true
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: 5.0.0
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew McKnight
@@ -40,7 +40,7 @@ dependencies:
40
40
  version: '2.1'
41
41
  description: |2
42
42
  - xcsims: Delete all simulators and recreate one for each compatible platform and device type pairing.
43
- - sync-git: Make sure all your GitHub repos are cloned into a given directory and keep them synced with upstream. Forks are maintained with a remote for both the fork and upstream, both remotes' default branches are tracked in local counterparts, and the upstream default branch is also pushed to the fork.
43
+ - sync-git-remotes: Make sure all your GitHub repos are cloned into a given directory and keep them synced with upstream. Forks are maintained with a remote for both the fork and upstream, both remotes' default branches are tracked in local counterparts, and the upstream default branch is also pushed to the fork.
44
44
  - changetag: Extract changelog entries to write into git tag annotation messages.
45
45
  - prerelease-podspec: Branch and create/push a release candidate tag, modify the podspec to use that version tag, and try linting it.
46
46
  - release-podspec: Create a tag with the version and push it to repo origin, push podspec to CocoaPods trunk.
@@ -52,7 +52,7 @@ email: andrew@tworingsoft.com
52
52
  executables:
53
53
  - clean-rc-tags
54
54
  - xcsims
55
- - sync-git
55
+ - sync-git-remotes
56
56
  - changetag
57
57
  - prerelease-podspec
58
58
  - release-podspec
@@ -69,7 +69,7 @@ files:
69
69
  - bin/prerelease-podspec
70
70
  - bin/release-podspec
71
71
  - bin/revert-failed-release-tag
72
- - bin/sync-git
72
+ - bin/sync-git-remotes
73
73
  - bin/xcsims
74
74
  - lib/echoexec.rb
75
75
  - lib/errors.rb