-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Hugo extended #65
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
module.exports = require('./lib').path(); | ||
module.exports = require('./lib')(process.cwd()).path(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
const path = require('path'); | ||
const BinWrapper = require('bin-wrapper'); | ||
const pkgConf = require('pkg-conf'); | ||
const pkg = require('../package'); | ||
|
||
const hugoVersion = pkg.hugoVersion; | ||
|
@@ -29,9 +30,23 @@ const binNameMap = { | |
x64: 'hugo.exe' | ||
} | ||
}; | ||
const dest = path.join(__dirname, '../vendor'); | ||
const binName = (binNameMap[process.platform] && binNameMap[process.platform][process.arch]) || ''; | ||
|
||
module.exports = new BinWrapper() | ||
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') | ||
.src(`${baseUrl}hugo_extended_${hugoVersion}_Windows-64bit.zip`, 'win32', 'x64') | ||
// Falling back to normal version on non supported platforms | ||
.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-ARM.tar.gz`, 'freebsd', 'arm') | ||
.src(`${baseUrl}hugo_${hugoVersion}_Linux-32bit.tar.gz`, 'linux', 'x86') | ||
.src(`${baseUrl}hugo_${hugoVersion}_Linux-ARM.tar.gz`, 'linux', 'arm') | ||
.src(`${baseUrl}hugo_${hugoVersion}_macOS-32bit.tar.gz`, 'darwin', 'x86') | ||
.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') | ||
.src(`${baseUrl}hugo_${hugoVersion}_FreeBSD-ARM.tar.gz`, 'freebsd', 'arm') | ||
|
@@ -42,5 +57,10 @@ module.exports = new BinWrapper() | |
.src(`${baseUrl}hugo_${hugoVersion}_macOS-64bit.tar.gz`, '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')) | ||
.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'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @satoshun00: I wonder, is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oops |
||
return extended ? extendedBin : normalBin; | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.