-
Notifications
You must be signed in to change notification settings - Fork 162
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
feat: install latest hugo according to platform #407
Conversation
Signed-off-by: Harshita-Kanal <harshita.kgv@gmail.com>
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.
Note: We'll also want to add something like:
HUGO_BIN=./tools/bin/hugo
and then use that variable when calling the hugo
executable anywhere in the Makefile.
cd tools; mkdir bin; cd bin; curl -L -O $(shell curl https://api.github.com/repos/gohugoio/hugo/releases/latest | jq -r '.assets[30].browser_download_url') | ||
|
||
else | ||
@echo $(shell uname -s) |
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.
Taken from https://stackoverflow.com/a/12099167/552902
Something like this should work.
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
// macOS
else
// assumed linux
endif
@Harshita-Kanal 👈 (poke) Is this something you are still interested in resolving. It looks to be so close to being done. |
Yes just missed it, sorry for the delay! |
Signed-off-by: Harshita-Kanal <harshita.kgv@gmail.com>
231410a
to
b3a0ddd
Compare
Signed-off-by: Harshita-Kanal <harshita.kgv@gmail.com>
Was able to get it to work for Linux I think. How should we handle the case for Windows? |
Summary
The approach here uses the GitHub API to fetch the
browser_download_url
which is obtained by parsing the JSON response. For windows, this gets the latest zip file of Hugo extended for windows OS. However, the implementation for Mac, Linux is a work in progress.Related
Fixes #395
Signed-off-by: Harshita-Kanal harshita.kgv@gmail.com