<commit_before>#!/bin/bash
set -e

readonly REV_NEWSPEAK="7fed4bc928ac3fa85fa28493ca1e26c359f875ac"
readonly REV_NSBOOT="abb722e474e2126203f05245e9da45c065efe991"
readonly GH_BASE="https://github.com/newspeaklanguage"
readonly TMP_DIR=$(mktemp -d 2>/dev/null || mktemp -d -t 'newspeak')

source ./.travis_helpers.sh

case "$(uname -s)" in
  "Linux"|"Darwin")
    ;;
  *)
    echo "Skipping Newspeak bootstrapping process..."
    exit
    ;;
esac

travis_fold start ns_bootstrap "Starting Newspeak bootstrapping process.."

pushd "${TMP_DIR}" > /dev/null

curl -f -s -L --retry 3 -o "newspeak.zip" "${GH_BASE}/newspeak/archive/${REV_NEWSPEAK}.zip"
curl -f -s -L --retry 3 -o "nsboot.zip" "${GH_BASE}/nsboot/archive/${REV_NSBOOT}.zip"

unzip -q "newspeak.zip"
unzip -q "nsboot.zip"

mv "newspeak-${REV_NEWSPEAK}" "newspeak"
mv "nsboot-${REV_NSBOOT}" "nsboot"

cd "nsboot"

if [[ "${ARCH}" = *"64x64" ]]; then
  BUILD_SCRIPT="./build64.sh"
else
  BUILD_SCRIPT="./build32.sh"
fi

case "$(uname -s)" in
  "Linux")
    NSVM=$(find "${TRAVIS_BUILD_DIR}/products" -type f -name "nsvm" | head -n 1)
    ;;
  "Darwin")
    VM_BUILD_DIR="${TRAVIS_BUILD_DIR}/build.${ARCH}/${FLAVOR}"
    NSVM="${VM_BUILD_DIR}/CocoaFast.app/Contents/MacOS/Newspeak Virtual Machine"
    ;;
esac

if [[ ! -f "${NSVM}" ]]; then
  echo "Could not locate VM."
  exit 1
fi

"${BUILD_SCRIPT}" -t -u -v "${NSVM}"
<commit_msg>Update revision for nsboot. Look specifically for "bin/nsvm" on Linux.<commit_after>#!/bin/bash
set -e

readonly REV_NEWSPEAK="7fed4bc928ac3fa85fa28493ca1e26c359f875ac"
readonly REV_NSBOOT="afc5b23866b518d926e300bca9efdf41b6e62fe0"
readonly GH_BASE="https://github.com/newspeaklanguage"
readonly TMP_DIR=$(mktemp -d 2>/dev/null || mktemp -d -t 'newspeak')

source ./.travis_helpers.sh

case "$(uname -s)" in
  "Linux"|"Darwin")
    ;;
  *)
    echo "Skipping Newspeak bootstrapping process..."
    exit
    ;;
esac

travis_fold start ns_bootstrap "Starting Newspeak bootstrapping process.."

pushd "${TMP_DIR}" > /dev/null

curl -f -s -L --retry 3 -o "newspeak.zip" "${GH_BASE}/newspeak/archive/${REV_NEWSPEAK}.zip"
curl -f -s -L --retry 3 -o "nsboot.zip" "${GH_BASE}/nsboot/archive/${REV_NSBOOT}.zip"

unzip -q "newspeak.zip"
unzip -q "nsboot.zip"

mv "newspeak-${REV_NEWSPEAK}" "newspeak"
mv "nsboot-${REV_NSBOOT}" "nsboot"

cd "nsboot"

if [[ "${ARCH}" = *"64x64" ]]; then
  BUILD_SCRIPT="./build64.sh"
else
  BUILD_SCRIPT="./build32.sh"
fi

case "$(uname -s)" in
  "Linux")
    NSVM=$(find "${TRAVIS_BUILD_DIR}/products" -type f -path "*/bin/nsvm" | head -n 1)
    ;;
  "Darwin")
    VM_BUILD_DIR="${TRAVIS_BUILD_DIR}/build.${ARCH}/${FLAVOR}"
    NSVM="${VM_BUILD_DIR}/CocoaFast.app/Contents/MacOS/Newspeak Virtual Machine"
    ;;
esac

if [[ ! -f "${NSVM}" ]]; then
  echo "Could not locate VM."
  exit 1
fi

"${BUILD_SCRIPT}" -t -u -v "${NSVM}"

{'fraction_non_alphanumeric': 0.18245861218738993, 'fraction_numerical': 0.041916167664670656, 'mean_word_length': 4.062388591800357, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6509613', 'n_tokens_mistral': 1315, 'n_tokens_neox': 1202, 'n_words': 245}