1
mirror of https://github.com/jakejarvis/hugo-extended.git synced 2025-07-19 09:45:30 -04:00

feat(hugo): upgrade Hugo to v0.17 (#9)

This commit is contained in:
Shun Sato
2016-10-19 23:36:34 +09:00
committed by GitHub
parent 730f7309e6
commit 2babfd561c
10 changed files with 64 additions and 330 deletions

View File

@@ -1,3 +1,41 @@
const bin = require('./binary');
const path = require('path');
const BinWrapper = require('bin-wrapper');
const pkg = require('../package');
module.exports = bin.path();
const hugoVersion = pkg.hugoVersion;
const baseUrl = `https://github.com/spf13/hugo/releases/download/v${hugoVersion}/`;
const binNameMap = {
darwin: {
ia32: `hugo_${hugoVersion}_darwin_386`,
x64: `hugo_${hugoVersion}_darwin_amd64`
},
freebsd: {
arm: `hugo_${hugoVersion}_freebsd_arm`,
ia32: `hugo_${hugoVersion}_freebsd_386`,
x64: `hugo_${hugoVersion}_freebsd_amd64`
},
linux: {
arm: `hugo_${hugoVersion}_linux_arm`,
ia32: `hugo_${hugoVersion}_linux_386`,
x64: `hugo_${hugoVersion}_linux_amd64`
},
win32: {
ia32: `hugo_${hugoVersion}_windows_386.exe`,
x64: `hugo_${hugoVersion}_windows_amd64.exe`
}
};
const binName = (binNameMap[process.platform] && binNameMap[process.platform][process.arch]) || '';
module.exports = new BinWrapper()
.src(`${baseUrl}hugo_${hugoVersion}_FreeBSD-32bit.zip`, 'freebsd', 'x86')
.src(`${baseUrl}hugo_${hugoVersion}_FreeBSD-64bit.zip`, 'freebsd', 'x64')
.src(`${baseUrl}hugo_${hugoVersion}_freebsd_arm.zip`, 'freebsd', 'arm')
.src(`${baseUrl}hugo_${hugoVersion}_Linux-32bit.tar.gz`, 'linux', 'x86')
.src(`${baseUrl}hugo_${hugoVersion}_Linux-64bit.tar.gz`, 'linux', 'x64')
.src(`${baseUrl}hugo_${hugoVersion}_linux_arm.tar.gz`, 'linux', 'arm')
.src(`${baseUrl}hugo_${hugoVersion}_MacOS-32bit.zip`, 'darwin', 'x86')
.src(`${baseUrl}hugo_${hugoVersion}_MacOS-64bit.zip`, 'darwin', 'x64')
.src(`${baseUrl}hugo_${hugoVersion}_Windows-32bit.zip`, 'win32', 'x86')
.src(`${baseUrl}hugo_${hugoVersion}_Windows-64bit.zip`, 'win32', 'x64')
.dest(path.join(__dirname, '../vendor'))
.use(binName);