fix: handle Hugo 0.139.5 archive fallback (#696)

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Shohei Ueda
2026-05-11 01:05:09 +09:00
committed by GitHub
co-authored by Codex
parent c2f9fa4376
commit 4e5bf412f0
3 changed files with 35 additions and 5 deletions
+14 -1
View File
@@ -1,4 +1,4 @@
import getURL from '../src/get-url';
import getURL, {getDownloadVersion} from '../src/get-url';
describe('getURL()', () => {
test('get URLs to Linux assets', () => {
@@ -139,6 +139,19 @@ describe('getURL()', () => {
]);
});
test('get URLs to Hugo 0.139.5 archive alias', () => {
const baseURL = 'https://github.com/gohugoio/hugo/releases/download/v0.139.4';
expect(getDownloadVersion('0.139.5')).toBe('0.139.4');
expect(getURL('linux', 'amd64', 'true', '0.139.5')).toEqual([
`${baseURL}/hugo_extended_0.139.4_linux-amd64.tar.gz`,
`${baseURL}/hugo_extended_0.139.4_Linux-amd64.tar.gz`,
`${baseURL}/hugo_extended_0.139.4_Linux_amd64.tar.gz`,
`${baseURL}/hugo_extended_v0.139.4_linux-amd64.tar.gz`,
`${baseURL}/hugo_extended_v0.139.4_Linux-amd64.tar.gz`,
`${baseURL}/hugo_extended_v0.139.4_Linux_amd64.tar.gz`
]);
});
test('get a fallback URL to an unknown OS asset', () => {
const baseURL = 'https://github.com/gohugoio/hugo/releases/download/v0.58.2';
expect(getURL('MyOS', '64bit', 'false', '0.58.2')).toEqual([