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

helpers/content.go: call rst2html directly on *nix but via python on windows #5285

Merged
merged 1 commit into from Oct 11, 2018

Conversation

Projects
None yet
3 participants
@shreyanshk
Copy link
Contributor

shreyanshk commented Oct 3, 2018

Initially, rst2html was called via the python interpreter which would
fail if the script was wrapped in a launcher as on NixOS.
Ideally, on *nix, binaries should be invoked directly to ensure that
shebangs work properly as is being done now.
Handle the case of windows as it doesn't do shebangs.

@shreyanshk

This comment has been minimized.

Copy link
Contributor Author

shreyanshk commented Oct 3, 2018

For reference:
#5273
#5167

@bep
Please test on windows as I don't have a windows machine handy.

// handle Windows manually because it doesn't do shebangs
if runtime.GOOS == "windows" {
args := []string{path, "--leave-comments", "--initial-header-level=2"}
result = externallyRenderContent(ctx, python, args)

This comment has been minimized.

@Mic92

Mic92 Oct 3, 2018

I also would move python := getPythonExecPath() here because in the other case it is not necessary and could even produce failures.

This comment has been minimized.

@bep

bep Oct 3, 2018

Member

Agree.

This comment has been minimized.

@shreyanshk

shreyanshk Oct 4, 2018

Author Contributor

There you go.

helpers/content.go: call rst2html directly on *nix but via python on …
…windows

Initially, rst2html was called via the python interpreter which would
fail if the script was wrapped in a launcher as on NixOS.
Ideally, on *nix, binaries should be invoked directly to ensure that
shebangs work properly as is being done now.
Handle the case of windows as it doesn't do shebangs.

@bep bep requested a review from anthonyfok Oct 4, 2018

@bep bep merged commit 3d4a988 into gohugoio:master Oct 11, 2018

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.