1
mirror of https://github.com/jakejarvis/hugo-extended.git synced 2025-04-27 14:46:22 -04:00
hugo-extended/lib/index.js
Jake Jarvis 6c87e415dc
allow binaries in vendor folder to be cached
aka: don't delete binaries in node_modules folder, since they shouldn't change anyways (unless the package is also updated)
2020-02-18 17:40:51 -05:00

24 lines
1.2 KiB
JavaScript

'use strict';
const path = require('path');
const binWrapper = require('bin-wrapper');
const { hugoVersion } = require('../package.json');
const baseUrl = `https://github.com/gohugoio/hugo/releases/download/v${hugoVersion}/`;
// Default to extended Hugo, fall back to vanilla Hugo on unsupported platforms
// eslint-disable-next-line new-cap
module.exports = new binWrapper()
.src(`${baseUrl}hugo_extended_${hugoVersion}_Linux-64bit.tar.gz`, 'linux', 'x64')
.src(`${baseUrl}hugo_${hugoVersion}_Linux-32bit.tar.gz`, 'linux', 'x86')
.src(`${baseUrl}hugo_${hugoVersion}_Linux-ARM.tar.gz`, 'linux', 'arm')
.src(`${baseUrl}hugo_extended_${hugoVersion}_macOS-64bit.tar.gz`, 'darwin', 'x64')
.src(`${baseUrl}hugo_${hugoVersion}_macOS-32bit.tar.gz`, 'darwin', 'x86')
.src(`${baseUrl}hugo_extended_${hugoVersion}_Windows-64bit.zip`, 'win32', 'x64')
.src(`${baseUrl}hugo_${hugoVersion}_Windows-32bit.zip`, 'win32', 'x86')
.src(`${baseUrl}hugo_${hugoVersion}_FreeBSD-64bit.tar.gz`, 'freebsd', 'x64')
.src(`${baseUrl}hugo_${hugoVersion}_FreeBSD-32bit.tar.gz`, 'freebsd', 'x86')
.src(`${baseUrl}hugo_${hugoVersion}_FreeBSD-ARM.tar.gz`, 'freebsd', 'arm')
.dest(path.join(__dirname, '../vendor'))
.use(process.platform === 'win32' ? 'hugo.exe' : 'hugo');