mirror of
https://github.com/jakejarvis/hugo-extended.git
synced 2025-04-27 02:18:27 -04:00
Remove unneeded condition.
This commit is contained in:
parent
57683e448b
commit
f2b396c1a8
@ -5,6 +5,7 @@ const pkg = require('../package');
|
|||||||
|
|
||||||
const hugoVersion = pkg.hugoVersion;
|
const hugoVersion = pkg.hugoVersion;
|
||||||
const baseUrl = `https://github.com/gohugoio/hugo/releases/download/v${hugoVersion}/`;
|
const baseUrl = `https://github.com/gohugoio/hugo/releases/download/v${hugoVersion}/`;
|
||||||
|
|
||||||
const binNameMap = {
|
const binNameMap = {
|
||||||
darwin: {
|
darwin: {
|
||||||
ia32: 'hugo',
|
ia32: 'hugo',
|
||||||
@ -30,8 +31,10 @@ const binNameMap = {
|
|||||||
x64: 'hugo.exe'
|
x64: 'hugo.exe'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const dest = path.join(__dirname, '../vendor');
|
const dest = path.join(__dirname, '../vendor');
|
||||||
const binName = (binNameMap[process.platform] && binNameMap[process.platform][process.arch]) || '';
|
const binName = (binNameMap[process.platform] && binNameMap[process.platform][process.arch]) || '';
|
||||||
|
|
||||||
const extendedBin = new BinWrapper()
|
const extendedBin = new BinWrapper()
|
||||||
.src(`${baseUrl}hugo_extended_${hugoVersion}_Linux-64bit.tar.gz`, 'linux', 'x64')
|
.src(`${baseUrl}hugo_extended_${hugoVersion}_Linux-64bit.tar.gz`, 'linux', 'x64')
|
||||||
.src(`${baseUrl}hugo_extended_${hugoVersion}_macOS-64bit.tar.gz`, 'darwin', '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')
|
.src(`${baseUrl}hugo_${hugoVersion}_Windows-32bit.zip`, 'win32', 'x86')
|
||||||
.dest(dest)
|
.dest(dest)
|
||||||
.use(binName);
|
.use(binName);
|
||||||
|
|
||||||
const normalBin = new BinWrapper()
|
const normalBin = new BinWrapper()
|
||||||
.src(`${baseUrl}hugo_${hugoVersion}_FreeBSD-32bit.tar.gz`, 'freebsd', 'x86')
|
.src(`${baseUrl}hugo_${hugoVersion}_FreeBSD-32bit.tar.gz`, 'freebsd', 'x86')
|
||||||
.src(`${baseUrl}hugo_${hugoVersion}_FreeBSD-64bit.tar.gz`, 'freebsd', 'x64')
|
.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')
|
.src(`${baseUrl}hugo_${hugoVersion}_Windows-64bit.zip`, 'win32', 'x64')
|
||||||
.dest(dest)
|
.dest(dest)
|
||||||
.use(binName);
|
.use(binName);
|
||||||
|
|
||||||
module.exports = projectRoot => {
|
module.exports = projectRoot => {
|
||||||
const config = pkgConf.sync('hugo-bin', { cwd: 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;
|
return extended ? extendedBin : normalBin;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user