|
|
|
|
@ -19,8 +19,8 @@ export default function DownloadsPage({ downloadData }) {
|
|
|
|
|
|
|
|
|
|
export async function getStaticProps() {
|
|
|
|
|
return fetch(`https://releases.hashicorp.com/packer/${VERSION}/index.json`)
|
|
|
|
|
.then(r => r.json())
|
|
|
|
|
.then(r => {
|
|
|
|
|
.then((r) => r.json())
|
|
|
|
|
.then((r) => {
|
|
|
|
|
// TODO: restructure product-downloader to run this logic internally
|
|
|
|
|
return r.builds.reduce((acc, build) => {
|
|
|
|
|
if (!acc[build.os]) acc[build.os] = {}
|
|
|
|
|
@ -28,7 +28,7 @@ export async function getStaticProps() {
|
|
|
|
|
return acc
|
|
|
|
|
}, {})
|
|
|
|
|
})
|
|
|
|
|
.then(r => ({ props: { downloadData: r } }))
|
|
|
|
|
.then((r) => ({ props: { downloadData: r } }))
|
|
|
|
|
.catch(() => {
|
|
|
|
|
throw new Error(
|
|
|
|
|
`--------------------------------------------------------
|
|
|
|
|
|