build_brew.sh 792 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/env bash
  2. ### Bash Environment Setup
  3. # http://redsymbol.net/articles/unofficial-bash-strict-mode/
  4. # https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
  5. # set -o xtrace
  6. set -o errexit
  7. set -o errtrace
  8. set -o nounset
  9. set -o pipefail
  10. IFS=$'\n'
  11. REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd .. && pwd )"
  12. CURRENT_PLAFORM="$(uname)"
  13. REQUIRED_PLATFORM="Darwin"
  14. if [[ "$CURRENT_PLAFORM" != "$REQUIRED_PLATFORM" ]]; then
  15. echo "[!] Skipping the Homebrew package build on $CURRENT_PLAFORM (it can only be run on $REQUIRED_PLATFORM)."
  16. exit 0
  17. fi
  18. cd "$REPO_DIR/brew_dist"
  19. # make sure archivebox.rb is up-to-date with the dependencies
  20. echo "[+] Building Homebrew bottle"
  21. brew install --build-bottle ./archivebox.rb
  22. brew bottle archivebox