-
-
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
Conversation
lib/index.js
Outdated
@@ -30,17 +33,17 @@ const binNameMap = { | |||
} | |||
}; | |||
const binName = (binNameMap[process.platform] && binNameMap[process.platform][process.arch]) || ''; | |||
|
|||
const srcPrefix = `hugo${extended ? '_extended' : ''}_${hugoVersion}_`; |
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.
📝 bin-wrapper supports multi files download
/~https://github.com/kevva/bin-wrapper/blob/master/index.js#L165
lib/index.js
Outdated
const pkg = require('../package'); | ||
|
||
const hugoVersion = pkg.hugoVersion; | ||
const config = pkgConf.sync('hugo-bin'); | ||
const hugoVersion = process.env.HUGO_BIN_VERSION || process.env.npm_config_hugo_bin_version || config.version || pkg.defaultHugoVersion; |
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.
Are you sure config.version
should be here?
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.
On second thought, supposing checksum feature for the future, it's not make sense to set hugoVersion on user configuration.
Because it would force users to set all of version,os,platform,checksum in their configuraton file.
I remove this line.
I cannot get project root config by pkg-conf correctly because Back to wip. |
README.md
Outdated
@@ -8,6 +8,8 @@ | |||
npm install --save-dev hugo-bin | |||
``` | |||
|
|||
hugo-bin now supports [Extended version of Hugo](/~https://github.com/gohugoio/hugo/releases/tag/v0.43). See [Installation options](#installation-options) for more detail. |
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.
detail -> details
README.md
Outdated
@@ -42,6 +44,46 @@ npm run create -- 'post/my-new-post' # see below 'npm-run-script' | |||
|
|||
See the [Hugo Documentation](https://gohugo.io/) for more information. | |||
|
|||
## Installation options | |||
|
|||
hugo-bin supports options to change variation of Hugo binaries. |
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.
to change -> to change the
README.md
Outdated
|
||
hugo-bin supports options to change variation of Hugo binaries. | ||
|
||
Each options can be configured in the `hugo-bin` section of your `package.json`: |
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.
options -> option
README.md
Outdated
|
||
Default: `""` | ||
|
||
Set it to `extended` to download [extended version](/~https://github.com/gohugoio/hugo/releases/tag/v0.43) binary. |
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.
to download -> to download the
README.md
Outdated
|
||
Set it to `extended` to download [extended version](/~https://github.com/gohugoio/hugo/releases/tag/v0.43) binary. | ||
|
||
If this set to `extended` but it's not available for the user's platform, then the normal version would be downloaded instead. |
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.
this -> this is
would be -> will be
|
@@ -8,7 +8,7 @@ | |||
npm install --save-dev hugo-bin |
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.
- fix some grammer mistakes
- fix getting project root issue
@satoshun00: maybe you could just release the usual, normal version until this is ready? There have been a lot of changes and fixes especially the variables overwrites feature. |
Friendly ping @satoshun00, see above. |
@XhmikosR Sorry for late reply. I think followings may be easy to understand.
I'll merge these changes and start integration test. |
.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 comment
The reason will be displayed to describe this comment to others. Learn more.
@satoshun00: I wonder, is the || ''
needed? Because later in the return
statement you check for this anyway.
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.
oops || ''
is not needed!
ref: #60, #61
Supportnpm i
args like node-sass (or not).