-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for different processor architectures (#518)
ARM, ARM64
- Loading branch information
1 parent
65bdbf1
commit 6d30a88
Showing
10 changed files
with
452 additions
and
311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"name":"hugo","full_name":"hugo","oldname":null,"aliases":[],"versioned_formulae":[],"desc":"Configurable static site generator","homepage":"https://gohugo.io/","versions":{"stable":"0.62.2","devel":null,"head":"HEAD","bottle":true},"revision":0,"version_scheme":0,"bottle":{"stable":{"rebuild":0,"cellar":":any_skip_relocation","prefix":"/usr/local","root_url":"https://homebrew.bintray.com/bottles","files":{"catalina":{"url":"https://homebrew.bintray.com/bottles/hugo-0.62.2.catalina.bottle.tar.gz","sha256":"354545c2c125e01a8860f83577fb4218d585fa8d38cd7f51e4228a149347fbcf"},"mojave":{"url":"https://homebrew.bintray.com/bottles/hugo-0.62.2.mojave.bottle.tar.gz","sha256":"9645b64fe6290c4c3b7591ef21139247f0fad6e49da1edd01665b3130a8f1d1a"},"high_sierra":{"url":"https://homebrew.bintray.com/bottles/hugo-0.62.2.high_sierra.bottle.tar.gz","sha256":"0ede4cbcc7536dd6b05107376637840356062273d734b4106be98b3d1732d50c"}}}},"keg_only":false,"bottle_disabled":false,"options":[],"build_dependencies":["go"],"dependencies":[],"recommended_dependencies":[],"optional_dependencies":[],"uses_from_macos":[],"requirements":[],"conflicts_with":[],"caveats":null,"installed":[],"linked_keg":null,"pinned":false,"outdated":false,"analytics":{"install":{"30d":{"hugo":24278,"hugo --HEAD":30},"90d":{"hugo":68639,"hugo --HEAD":80},"365d":{"hugo":223748,"hugo --HEAD":321}},"install_on_request":{"30d":{"hugo":23621,"hugo --HEAD":27},"90d":{"hugo":66676,"hugo --HEAD":74},"365d":{"hugo":215985,"hugo --HEAD":305}},"build_error":{"30d":{"hugo":0}}}} | ||
{"name":"hugo","full_name":"hugo","tap":"homebrew/core","oldname":null,"aliases":[],"versioned_formulae":[],"desc":"Configurable static site generator","license":"Apache-2.0","homepage":"https://gohugo.io/","versions":{"stable":"0.83.1","head":"HEAD","bottle":true},"urls":{"stable":{"url":"https://github.com/gohugoio/hugo/archive/v0.83.1.tar.gz","tag":null,"revision":null}},"revision":0,"version_scheme":0,"bottle":{"stable":{"rebuild":0,"root_url":"https://ghcr.io/v2/homebrew/core","files":{"arm64_big_sur":{"cellar":":any_skip_relocation","url":"https://ghcr.io/v2/homebrew/core/hugo/blobs/sha256:f5997a1858e300787cd6e2e01ff8f87f0d3233f42af4becc040448ce06524d53","sha256":"f5997a1858e300787cd6e2e01ff8f87f0d3233f42af4becc040448ce06524d53"},"big_sur":{"cellar":":any_skip_relocation","url":"https://ghcr.io/v2/homebrew/core/hugo/blobs/sha256:32ad322954e9c2962849495c88c88e461d21a0a7d3bfa3aa4892ee34f569bf81","sha256":"32ad322954e9c2962849495c88c88e461d21a0a7d3bfa3aa4892ee34f569bf81"},"catalina":{"cellar":":any_skip_relocation","url":"https://ghcr.io/v2/homebrew/core/hugo/blobs/sha256:99078c665152420113fac08aaea7bdf2f8fe230696b724448bb9f2244cfdec55","sha256":"99078c665152420113fac08aaea7bdf2f8fe230696b724448bb9f2244cfdec55"},"mojave":{"cellar":":any_skip_relocation","url":"https://ghcr.io/v2/homebrew/core/hugo/blobs/sha256:a45ae895351a549639b40bdbb2a630e8a11ffb68d78a0aa7577faedce4c011d4","sha256":"a45ae895351a549639b40bdbb2a630e8a11ffb68d78a0aa7577faedce4c011d4"}}}},"keg_only":false,"bottle_disabled":false,"options":[],"build_dependencies":["go"],"dependencies":[],"recommended_dependencies":[],"optional_dependencies":[],"uses_from_macos":[],"requirements":[],"conflicts_with":[],"caveats":null,"installed":[],"linked_keg":null,"pinned":false,"outdated":false,"deprecated":false,"deprecation_date":null,"deprecation_reason":null,"disabled":false,"disable_date":null,"disable_reason":null,"analytics":{"install":{"30d":{"hugo":24137,"hugo --HEAD":16},"90d":{"hugo":61006,"hugo --HEAD":51},"365d":{"hugo":246915,"hugo --HEAD":273}},"install_on_request":{"30d":{"hugo":24100,"hugo --HEAD":16},"90d":{"hugo":60903,"hugo --HEAD":51},"365d":{"hugo":244317,"hugo --HEAD":266}},"build_error":{"30d":{"hugo":0}}},"generated_date":"2021-05-21"} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import getArch from '../src/get-arch'; | ||
|
||
describe('getArch', () => { | ||
test('processor architecture', () => { | ||
expect(getArch('x64')).toBe('64bit'); | ||
expect(getArch('arm')).toBe('ARM'); | ||
expect(getArch('arm64')).toBe('ARM64'); | ||
}); | ||
|
||
test('exception', () => { | ||
expect(() => { | ||
getArch('mips'); | ||
}).toThrowError('mips is not supported'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export default function getArch(arch: string): string { | ||
switch (arch) { | ||
case 'x64': | ||
return '64bit'; | ||
case 'arm': | ||
return 'ARM'; | ||
case 'arm64': | ||
return 'ARM64'; | ||
default: | ||
throw new Error(`${arch} is not supported`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
export default function getOS(platform: string): string { | ||
if (platform === 'linux') { | ||
return 'Linux'; | ||
} else if (platform === 'darwin') { | ||
return 'macOS'; | ||
} else if (platform === 'win32') { | ||
return 'Windows'; | ||
} else { | ||
throw new Error(`${platform} is not supported`); | ||
switch (platform) { | ||
case 'linux': | ||
return 'Linux'; | ||
case 'darwin': | ||
return 'macOS'; | ||
case 'win32': | ||
return 'Windows'; | ||
default: | ||
throw new Error(`${platform} is not supported`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters