#!/bin/bash if [[ -f "data.tar.gz" || -f "v8.tgz" || -d "v8" ]]; then echo "Pre-built v8 binaries already seem to be present under the 'v8' directory or within the fetched tarballs. Invoke 'make clean' if you want this script to set them up again." exit 1 fi if [[ "$OSTYPE" == "linux-gnu" ]]; then echo "Fetching pre-built v8 for Linux..." curl -o v8.tgz https://rubygems.org/downloads/libv8-7.3.492.27.1-x86_64-linux.gem elif [[ "$OSTYPE" == "darwin"* ]]; then echo "Fetching pre-built v8 for OSX..." curl -o v8.tgz https://rubygems.org/downloads/libv8-7.3.492.27.1-x86_64-darwin-19.gem else echo "OS not supported" exit 2 fi tar xvf v8.tgz data.tar.gz mkdir v8 tar xvf data.tar.gz -C v8 rm -rf v8.tgz data.tar.gz