Skip to content
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

Merged
merged 3 commits into from
Oct 7, 2018
Merged

Conversation

satoshun00
Copy link
Member

@satoshun00 satoshun00 commented Jul 30, 2018

ref: #60, #61

  • Support npm i args like node-sass (or not).
  • Fallback to normal version.
  • Update README

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}_`;
Copy link
Member Author

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;
Copy link
Collaborator

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?

Copy link
Member Author

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.

@satoshun00 satoshun00 changed the title wip: Support Hugo extended Support Hugo extended Aug 11, 2018
@satoshun00
Copy link
Member Author

satoshun00 commented Aug 11, 2018

wip removed.
in-review until next week.

I cannot get project root config by pkg-conf correctly because process.cwd() on postinstall process point to hugo-bin package root.

Back to wip.

@satoshun00 satoshun00 changed the title Support Hugo extended wip: Support Hugo extended Aug 11, 2018
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.
Copy link
Collaborator

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.
Copy link
Collaborator

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`:
Copy link
Collaborator

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.
Copy link
Collaborator

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.
Copy link
Collaborator

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

@satoshun00 satoshun00 changed the title wip: Support Hugo extended Support Hugo extended Sep 2, 2018
@satoshun00
Copy link
Member Author

wip removed.
in-review until next week.

@@ -8,7 +8,7 @@
npm install --save-dev hugo-bin
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@XhmikosR
Copy link
Collaborator

XhmikosR commented Sep 5, 2018

@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.

@XhmikosR
Copy link
Collaborator

Friendly ping @satoshun00, see above.

@satoshun00
Copy link
Member Author

@XhmikosR Sorry for late reply.
I would like to release these changes with upgrading hugo to 0.43 because it's difficult to manage breaking changes and versions.

I think followings may be easy to understand.

  • v0.31.0 -> hugo-0.43 and these changes
  • v0.32.0 -> hugo-0.44
  • ...

I'll merge these changes and start integration test.

@satoshun00 satoshun00 merged commit 1113135 into fenneclab:master Oct 7, 2018
@satoshun00 satoshun00 deleted the feat/extended branch October 7, 2018 08:15
.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';
Copy link
Collaborator

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops || '' is not needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants