Skip to content

Commit

Permalink
Merge pull request #1911 from dscho/fix-updating-windows-download-data
Browse files Browse the repository at this point in the history
update-download-data: accommodate for Git for Windows' four-part version format
  • Loading branch information
dscho authored Oct 27, 2024
2 parents faa0a7a + c328fb1 commit 3dab4c6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
32 changes: 16 additions & 16 deletions hugo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,22 @@ params:
filename: git-2.33.0-intel-universal-mavericks.dmg
windows_installer:
portable32:
filename: PortableGit-2.47.0-32-bit.7z.exe
release_date: '2024-10-08'
version: 2.47.0
url: https://github.com/git-for-windows/git/releases/download/v2.47.0.windows.1/PortableGit-2.47.0-32-bit.7z.exe
filename: PortableGit-2.47.0.2-32-bit.7z.exe
release_date: '2024-10-22'
version: 2.47.0(2)
url: https://github.com/git-for-windows/git/releases/download/v2.47.0.windows.2/PortableGit-2.47.0.2-32-bit.7z.exe
portable64:
filename: PortableGit-2.47.0-64-bit.7z.exe
release_date: '2024-10-08'
version: 2.47.0
url: https://github.com/git-for-windows/git/releases/download/v2.47.0.windows.1/PortableGit-2.47.0-64-bit.7z.exe
filename: PortableGit-2.47.0.2-64-bit.7z.exe
release_date: '2024-10-22'
version: 2.47.0(2)
url: https://github.com/git-for-windows/git/releases/download/v2.47.0.windows.2/PortableGit-2.47.0.2-64-bit.7z.exe
installer32:
filename: Git-2.47.0-32-bit.exe
release_date: '2024-10-08'
version: 2.47.0
url: https://github.com/git-for-windows/git/releases/download/v2.47.0.windows.1/Git-2.47.0-32-bit.exe
filename: Git-2.47.0.2-32-bit.exe
release_date: '2024-10-22'
version: 2.47.0(2)
url: https://github.com/git-for-windows/git/releases/download/v2.47.0.windows.2/Git-2.47.0.2-32-bit.exe
installer64:
filename: Git-2.47.0-64-bit.exe
release_date: '2024-10-08'
version: 2.47.0
url: https://github.com/git-for-windows/git/releases/download/v2.47.0.windows.1/Git-2.47.0-64-bit.exe
filename: Git-2.47.0.2-64-bit.exe
release_date: '2024-10-22'
version: 2.47.0(2)
url: https://github.com/git-for-windows/git/releases/download/v2.47.0.windows.2/Git-2.47.0.2-64-bit.exe
8 changes: 5 additions & 3 deletions script/update-download-data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ def update_download_windows_versions(config)
bitness = match[3]

# Git for windows sometimes creates extra releases all based off of the same upstream Git version
# so we want to crop versions like 2.16.1.4 to just 2.16.1
# so we first want to crop versions like 2.16.1.4 to just 2.16.1
version = match[2].slice(/^\d+\.\d+\.\d+/)
# Now, as per Git for Windows' custom, append the fourth part in parens, e.g. 2.16.1(4)
version += "(#{match[2].slice(version.length + 1)})" if match[2][version.length] == "."

if version
config["windows_installer"] = {} if config["windows_installer"].nil?
Expand Down Expand Up @@ -119,8 +121,8 @@ def files_from_sourceforge(repository)
end

def version_compare(a, b)
a = a.nil? ? [] : a.gsub(/^v/, "").split(/\./)
b = b.nil? ? [] : b.gsub(/^v/, "").split(/\./)
a = a.nil? ? [] : a.gsub(/^v/, "").split(/[.()]/)
b = b.nil? ? [] : b.gsub(/^v/, "").split(/[.()]/)
while true
a0 = a.shift
b0 = b.shift
Expand Down

0 comments on commit 3dab4c6

Please sign in to comment.