Created
July 27, 2024 13:35
-
-
Save JakobMiksch/8f58b440f8d861c4aa085781a0b21d20 to your computer and use it in GitHub Desktop.
Hugo Go Download Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| HUGO_VERSION=$1 | |
| TMP_DOWNLOAD_FILE="hugo_${HUGO_VERSION}_Linux-64bit.tar.gz" | |
| URL="https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${TMP_DOWNLOAD_FILE}" | |
| HUGO_EXECUTABLE="hugo" | |
| HUGO_EXECUTABLE_EXPORT_NAME="hugo_${HUGO_VERSION}" | |
| echo "starting download ..." | |
| # Download the release asset | |
| wget -O ${TMP_DOWNLOAD_FILE} ${URL} | |
| echo "download finished ..." | |
| # Extract the hugo executable | |
| tar -xzvf ${TMP_DOWNLOAD_FILE} ${HUGO_EXECUTABLE} | |
| rm -rf ${TMP_DOWNLOAD_FILE} | |
| chmod +x ${HUGO_EXECUTABLE} | |
| mv ${HUGO_EXECUTABLE} ${HUGO_EXECUTABLE_EXPORT_NAME} | |
| echo "successfully downloaded hugo executable: ${HUGO_EXECUTABLE_EXPORT_NAME}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment