master_to_main 0.0.6 → 0.0.7
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/CHANGELOG.md +6 -0
- data/CONTRIBUTORS.md +1 -0
- data/Gemfile.lock +1 -1
- data/lib/master_to_main/cli.rb +5 -4
- data/lib/master_to_main/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c946d54f9f02e3fd4b826f9293f2d46d5c5ea6bd92d375976e56f7b30539c09f
|
4
|
+
data.tar.gz: dfb3ee1e58e811d8d265bca117b1ac4ca468ad3ea610f422a90199c1e71e9d90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c4472188bf291848ee7ccdade125d7b442cbb698617942ba3dff93b9d9a8e44ecfba597401fa0f561e1b785e1aded3b1157db9a821af25e4e54ab72b7d3bc23
|
7
|
+
data.tar.gz: cc81f28a699618888e1d8f0b79abfac319ad8fdf47ba815f4841030bbf5a495856caf9a2904bb457f9473eaaed34c41b78669b1cfa1532907f5ec1fad3a0c67e
|
data/CHANGELOG.md
CHANGED
data/CONTRIBUTORS.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
- [@woodbusy](https://github.com/woodbusy)
|
data/Gemfile.lock
CHANGED
data/lib/master_to_main/cli.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require "thor"
|
2
|
-
require "pry"
|
3
2
|
require "octokit"
|
4
3
|
|
5
4
|
module MasterToMain
|
@@ -89,7 +88,7 @@ module MasterToMain
|
|
89
88
|
def prompt_info
|
90
89
|
github_info = get_github_info
|
91
90
|
github_url = ask("What is your github url?", default: github_info[:github]).gsub(/https:\/\//, "")
|
92
|
-
user = ask("What is
|
91
|
+
user = ask("What is the repo's parent user/organization?", default: github_info[:user])
|
93
92
|
github_repo = ask("What is your github repo?", default: github_info[:repo]).gsub(/\.git/, "")
|
94
93
|
old_branch = ask("What is your current primary branch?", default: "master")
|
95
94
|
new_branch = ask("What is your desired primary branch?", default: "main")
|
@@ -100,7 +99,7 @@ module MasterToMain
|
|
100
99
|
def ensure_old_branch_exists
|
101
100
|
@client.branch(@repo.name, @repo.old_branch)
|
102
101
|
rescue Octokit::NotFound
|
103
|
-
say "The current primary branch does not exist, or do
|
102
|
+
say "The current primary branch does not exist, or you do not have access. Was there a typo?", :red
|
104
103
|
say "-----------------------"
|
105
104
|
say "CURRENT PRIMARY BRANCH: #{@repo.old_branch}", :green
|
106
105
|
exit 1
|
@@ -200,7 +199,9 @@ module MasterToMain
|
|
200
199
|
def _update_docs
|
201
200
|
say "This will update all references of #{@repo.old_branch} to #{@repo.new_branch} in the following lines in this repo:"
|
202
201
|
say "https://#{@repo.github}/#{@repo.name}/<tree|blob>/#{@repo.old_branch}"
|
203
|
-
Dir.glob(
|
202
|
+
Dir.glob("**/*.md").each do |path|
|
203
|
+
next if path.start_with?("vendor/")
|
204
|
+
path = File.expand_path(path, Dir.pwd)
|
204
205
|
gsub_file path, /#{@repo.old_branch_regex}/, @repo.new_branch_replacement, verbose: false
|
205
206
|
end
|
206
207
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: master_to_main
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John DeWyze
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -92,6 +92,7 @@ files:
|
|
92
92
|
- ".rspec"
|
93
93
|
- CHANGELOG.md
|
94
94
|
- CODE_OF_CONDUCT.md
|
95
|
+
- CONTRIBUTORS.md
|
95
96
|
- Gemfile
|
96
97
|
- Gemfile.lock
|
97
98
|
- LICENSE
|