serve.sh 477 B

1234567891011121314
  1. #!/bin/bash
  2. set -e
  3. binpath="${ROOT_DIR}/bin"
  4. if [ ! -e "${binpath}/hugo" ];
  5. then
  6. [[ ! -d "${binpath}" ]] && mkdir -p "${binpath}"
  7. wget https://github.com/gohugoio/hugo/releases/download/v"${HUGO_VERSION}"/hugo_extended_"${HUGO_VERSION}"_"${HUGO_PLATFORM}".tar.gz -O "$binpath"/hugo.tar.gz
  8. tar -xvf "$binpath"/hugo.tar.gz -C "${binpath}"
  9. rm -rf "$binpath"/hugo.tar.gz
  10. chmod +x "$binpath"/hugo
  11. fi
  12. "${binpath}/hugo" --baseURL="$BASE_URL" -s "$ROOT_DIR" serve