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

How to run with specific version in grunt? #33

Closed
bluecaret opened this issue Feb 21, 2020 · 2 comments
Closed

How to run with specific version in grunt? #33

bluecaret opened this issue Feb 21, 2020 · 2 comments

Comments

@bluecaret
Copy link

Hello, I'm trying to setup hugo-cli to use a specific version (the latest extended version) via a grunt-exec script but any time I do that I get an error:

>> 'HUGO_VERSION' is not recognized as an internal or external command,
>> operable program or batch file.
>> Exited with code: 1.
>> Error executing child process: Error: Command failed: HUGO_VERSION=extended_0.64.0 npx hugo-cli
>> 'HUGO_VERSION' is not recognized as an internal or external command,
>> operable program or batch file.

I think I have found that if I run it like this in a standard command prompt (via the below commands) it works, but I am unable to get this to work via grunt no matter the combinations I try.

> set HUGO_VERSION=extended_0.64.0
> npx hugo-cli

This is a windows machine.

Thanks!

@nikku
Copy link
Owner

nikku commented Feb 21, 2020

Please learn how to pass environment variables to the script you execute via grunt.

FOO=1 some-cmd

does not work on Windows. You could use cross-env to make things compatible.

@nikku nikku closed this as completed Feb 21, 2020
@bluecaret
Copy link
Author

Thank you for the quick response. cross-env is exactly what I was needing!

For anyone else, the link above doesn't work but I found it here: https://github.com/kentcdodds/cross-env

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

No branches or pull requests

2 participants