Skip to content

Commit 3dfd0b4

Browse files
committed
Merge branch 'drop-macos-installer-for-realz'
The Git for MacOS installer is no longer advertised or supported. There are some bits and pieces of metadata/tooling left, which this topic branch removes. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2 parents 0bb516b + 8bf3f56 commit 3dfd0b4

File tree

5 files changed

+96
-18
lines changed

5 files changed

+96
-18
lines changed

hugo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module:
3535
- source: external/docs/content
3636
target: content
3737
params:
38-
hugo_version: 0.148.2
38+
hugo_version: 0.152.2
3939
pagefind_version: 1.4.0
4040
latest_version: 2.52.0
4141
latest_relnote_url: https://github.com/git/git/raw/HEAD/Documentation/RelNotes/2.52.0.adoc

script/html-to-pdf.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ const htmlToPDF = async (htmlPath, options) => {
7676
landscape: true,
7777
margin: { top: '0cm', bottom: '0cm', left: '0cm', right: '0cm' },
7878
})
79+
console.log(`tagline was '${await page.evaluate(() => Print.taglineBackup)}'`)
7980
if (options.devtools) await new Promise((resolve) => { setTimeout(resolve, 5 * 60 * 1000) })
8081
await browser.close()
8182

script/install-hugo.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/sh
2+
3+
die() {
4+
echo "$*" >&2
5+
exit 1
6+
}
7+
8+
case "$MSYSTEM" in
9+
MINGW64)
10+
suffix=_windows-amd64.zip
11+
update() {
12+
unzip -d $HOME/bin /tmp/hugo$suffix hugo.exe
13+
}
14+
;;
15+
*)
16+
suffix=_linux-amd64.deb
17+
update() {
18+
sudo dpkg -i /tmp/hugo$suffix
19+
}
20+
;;
21+
esac
22+
23+
HUGO_VERSION=$(sed -n 's/^ *hugo_version: *//p' <hugo.yml) &&
24+
test -n "$HUGO_VERSION" ||
25+
die "hugo_version not found in hugo.yml"
26+
27+
echo "Upgrading to Hugo v${HUGO_VERSION}" >&2
28+
29+
download_url=https://github.com/gohugoio/hugo/releases/download &&
30+
curl -Lo /tmp/hugo$suffix $download_url/v$HUGO_VERSION/hugo_extended_${HUGO_VERSION}${suffix} &&
31+
update ||
32+
die "Failed to install Hugo version $HUGO_VERSION"
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/usr/bin/env ruby
2+
3+
require "logger"
4+
require "octokit"
5+
require "yaml"
6+
7+
$logger = Logger.new($stderr)
8+
9+
class ReleaseVersionUpdater
10+
REPOSITORIES = {
11+
"hugo_version" => "gohugoio/hugo",
12+
"pagefind_version" => "Pagefind/pagefind"
13+
}.freeze
14+
15+
class << self
16+
def update(params)
17+
REPOSITORIES.each do |key, repository|
18+
update_param(params, key, repository)
19+
end
20+
end
21+
22+
private
23+
24+
def update_param(params, key, repository)
25+
current = params[key]
26+
latest = begin
27+
release = octokit.latest_release(repository)
28+
tag_or_name = release && (release.tag_name || release.name)
29+
tag_or_name && tag_or_name.to_s.sub(/^v/, "")
30+
rescue Octokit::NotFound
31+
$logger.warn("Repository #{repository} not found")
32+
nil
33+
rescue StandardError => e
34+
$logger.error("Failed to fetch releases for #{repository}: #{e.class} - #{e.message}")
35+
nil
36+
end
37+
38+
if latest.nil?
39+
$logger.warn("No release found for #{repository}; keeping #{current.inspect}")
40+
return
41+
end
42+
43+
if current.to_s == latest.to_s
44+
$logger.info("#{key} already at #{current}")
45+
return
46+
end
47+
48+
params[key] = latest
49+
$logger.info("Updated #{key} to #{latest}")
50+
end
51+
52+
def octokit
53+
@octokit ||= Octokit::Client.new(access_token: ENV.fetch("GITHUB_API_TOKEN", nil))
54+
end
55+
end
56+
end
57+
58+
config = YAML.load_file("hugo.yml")
59+
config["params"] ||= {}
60+
ReleaseVersionUpdater.update(config["params"])
61+
yaml = YAML.dump(config).gsub(/ *$/, "")
62+
File.write("hugo.yml", yaml)

script/upgrade-hugo.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)