1
mirror of https://github.com/jakejarvis/hugo-extended.git synced 2025-04-26 16:58:26 -04:00

Remove unneeded condition.

This commit is contained in:
XhmikosR 2018-10-07 18:25:14 +03:00 committed by Shun Sato
parent 57683e448b
commit f2b396c1a8

View File

@ -5,6 +5,7 @@ const pkg = require('../package');
const hugoVersion = pkg.hugoVersion;
const baseUrl = `https://github.com/gohugoio/hugo/releases/download/v${hugoVersion}/`;
const binNameMap = {
darwin: {
ia32: 'hugo',
@ -30,8 +31,10 @@ const binNameMap = {
x64: 'hugo.exe'
}
};
const dest = path.join(__dirname, '../vendor');
const binName = (binNameMap[process.platform] && binNameMap[process.platform][process.arch]) || '';
const extendedBin = new BinWrapper()
.src(`${baseUrl}hugo_extended_${hugoVersion}_Linux-64bit.tar.gz`, 'linux', 'x64')
.src(`${baseUrl}hugo_extended_${hugoVersion}_macOS-64bit.tar.gz`, 'darwin', 'x64')
@ -46,6 +49,7 @@ const extendedBin = new BinWrapper()
.src(`${baseUrl}hugo_${hugoVersion}_Windows-32bit.zip`, 'win32', 'x86')
.dest(dest)
.use(binName);
const normalBin = new BinWrapper()
.src(`${baseUrl}hugo_${hugoVersion}_FreeBSD-32bit.tar.gz`, 'freebsd', 'x86')
.src(`${baseUrl}hugo_${hugoVersion}_FreeBSD-64bit.tar.gz`, 'freebsd', 'x64')
@ -59,8 +63,9 @@ const normalBin = new BinWrapper()
.src(`${baseUrl}hugo_${hugoVersion}_Windows-64bit.zip`, 'win32', 'x64')
.dest(dest)
.use(binName);
module.exports = projectRoot => {
const config = pkgConf.sync('hugo-bin', { cwd: projectRoot });
const extended = (process.env.HUGO_BIN_BUILD_TAGS || process.env.npm_config_hugo_bin_build_tags || config.buildTags || '') === 'extended';
const extended = (process.env.HUGO_BIN_BUILD_TAGS || process.env.npm_config_hugo_bin_build_tags || config.buildTags) === 'extended';
return extended ? extendedBin : normalBin;
};