Icarus-Mod-Tools 3.2.0 → 3.2.1
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 +5 -0
- data/Gemfile.lock +1 -1
- data/lib/icarus/mod/cli/add.rb +18 -2
- data/lib/icarus/mod/github.rb +9 -0
- data/lib/icarus/mod/tools/sync/modinfo_list.rb +4 -4
- data/lib/icarus/mod/tools/sync/toolinfo_list.rb +4 -4
- data/lib/icarus/mod/version.rb +1 -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: f71d742763b16a7a6cb096f6decf06568f415909ee0830f392315523b7ab307d
|
|
4
|
+
data.tar.gz: f5afb462e86cc8452508dad64b319d4c2246cad20a5963741efa43f2b76d873a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 96c885457a5b1e1998eea60852d62474a48c4b1b66ec4ccd4aede80f8300314bde8eb2e9cca637cdae7d6630e00d83fa33b0157af899ef50283e3a97760c25ee
|
|
7
|
+
data.tar.gz: deac9280f7a685695dbe3704ae48b990298a4559b3dd1d5cd5277bb51fef6fe92ab71f0fc8bfb05dda43a6a170c430729c4fac7b5e5f0f291d29f627ead1dba9
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## History (reverse chronological order)
|
|
6
6
|
|
|
7
|
+
### v3.2.1 - 2026-10-31
|
|
8
|
+
|
|
9
|
+
- Fix `imt add repos owner/repo` storing a bare `owner/repo`, which stage 1 of sync never searched (it only looked at entries containing "github"); it now stores the canonical `https://github.com/owner/repo` for any GitHub form, refuses non-GitHub repositories, and does nothing when the repository is already listed under any spelling
|
|
10
|
+
- Stage 1 of sync (`imt sync modinfo`/`toolinfo`) now also searches bare `owner/repo` entries already in `meta/repos`
|
|
11
|
+
|
|
7
12
|
### v3.2.0 - 2026-10-30
|
|
8
13
|
|
|
9
14
|
- Add `imt validate repo OWNER/REPO [--json]`, a read-only pre-check for a repo before it is added to `meta/repos` (repo state, info files, entry validation and link checks; exits 0/1/2)
|
data/Gemfile.lock
CHANGED
data/lib/icarus/mod/cli/add.rb
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "firestore"
|
|
4
|
+
require "github"
|
|
4
5
|
require "tools/modinfo"
|
|
5
6
|
|
|
6
7
|
module Icarus
|
|
@@ -22,7 +23,16 @@ module Icarus
|
|
|
22
23
|
|
|
23
24
|
desc "repos", "Adds an entry to 'meta/repos/list'"
|
|
24
25
|
def repos(item)
|
|
25
|
-
|
|
26
|
+
# Stage 1 of sync searches entries in the canonical URL form, so store that whatever form we were given
|
|
27
|
+
url = Github.canonical_url(item)
|
|
28
|
+
unless url
|
|
29
|
+
warn Paint["#{item} is not a GitHub repository (use owner/repo or a github.com URL)", :red]
|
|
30
|
+
exit 1
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
add_to_list(:repositories, :repositories, url) do |existing|
|
|
34
|
+
existing.any? { |entry| Github.canonical_url(entry)&.casecmp?(url) }
|
|
35
|
+
end
|
|
26
36
|
end
|
|
27
37
|
|
|
28
38
|
desc "mod", "Adds an entry to 'mods'"
|
|
@@ -78,7 +88,13 @@ module Icarus
|
|
|
78
88
|
end
|
|
79
89
|
|
|
80
90
|
firestore = Firestore.new
|
|
81
|
-
|
|
91
|
+
existing = firestore.send(collection)
|
|
92
|
+
if block_given? && yield(existing)
|
|
93
|
+
puts "#{item} is already listed"
|
|
94
|
+
return
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
payload = [existing, item].flatten.compact
|
|
82
98
|
|
|
83
99
|
exit 1 unless report(firestore.update(type, payload, merge: true))
|
|
84
100
|
end
|
data/lib/icarus/mod/github.rb
CHANGED
|
@@ -8,6 +8,15 @@ module Icarus
|
|
|
8
8
|
class Github
|
|
9
9
|
attr_reader :client, :resources
|
|
10
10
|
|
|
11
|
+
# owner/repo, optionally as a github.com URL (with .git, a trailing slash or a deeper path)
|
|
12
|
+
REPO_PATTERN = %r{\A(?:(?:https?://)?(?:www\.)?github\.com/)?([A-Za-z0-9][\w.-]*)/([\w.-]+?)(?:\.git)?(?:[/?#].*)?\z}
|
|
13
|
+
|
|
14
|
+
# The form meta/repos stores ("https://github.com/owner/repo"), or nil when +repo+ is not a GitHub repository
|
|
15
|
+
def self.canonical_url(repo)
|
|
16
|
+
match = REPO_PATTERN.match(repo.to_s.strip)
|
|
17
|
+
match && "https://github.com/#{match[1]}/#{match[2]}"
|
|
18
|
+
end
|
|
19
|
+
|
|
11
20
|
def initialize(repo = nil)
|
|
12
21
|
self.repository = repo if repo
|
|
13
22
|
@client = Octokit::Client.new(access_token: Config.github.token)
|
|
@@ -41,11 +41,11 @@ module Icarus
|
|
|
41
41
|
repositories.map do |repo|
|
|
42
42
|
print "searching #{repo}..." if verbose
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
# A GitHub URL, or a bare owner/repo (how `imt add repos` stored entries before 3.2.1)
|
|
45
|
+
if Github.canonical_url(repo)
|
|
46
46
|
find_modinfo(repo, verbose:)
|
|
47
|
-
|
|
48
|
-
puts "Skipped...repository type not supported yet"
|
|
47
|
+
elsif verbose
|
|
48
|
+
puts "Skipped...repository type not supported yet"
|
|
49
49
|
end
|
|
50
50
|
end.compact
|
|
51
51
|
end
|
|
@@ -41,11 +41,11 @@ module Icarus
|
|
|
41
41
|
repositories.map do |repo|
|
|
42
42
|
print "searching #{repo}..." if verbose
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
# A GitHub URL, or a bare owner/repo (how `imt add repos` stored entries before 3.2.1)
|
|
45
|
+
if Github.canonical_url(repo)
|
|
46
46
|
find_toolinfo(repo, verbose:)
|
|
47
|
-
|
|
48
|
-
puts "Skipped...repository type not supported yet"
|
|
47
|
+
elsif verbose
|
|
48
|
+
puts "Skipped...repository type not supported yet"
|
|
49
49
|
end
|
|
50
50
|
end.compact
|
|
51
51
|
end
|
data/lib/icarus/mod/version.rb
CHANGED