<commit_before>#!/usr/bin/env bash
# Stop at first error
set -e

# Grab the semver
semver="$1"
if test "$semver" = ""; then
  echo "Semver was not provided to \`release.sh\`. Please provide one" 1>&2
  echo "./release.sh <semver>" 1>&2
  exit 1
fi

# If we are on a dirty branch, stop
if test "$(git status --porcelain 2> /dev/null)" != ""; then
  echo "Current branch is dirty. Please stash or commit changes." 1>&2
  exit 1
fi

# Echo commands
set -x

# Build the latest (seems to dissapear when we use `buildbranch`)
./node_modules/.bin/grunt build

# DEV: We could use `npm-run-script` since as of 2.0, it supports variables
#   However, I am more familiar with `bash` for variable passing at the moment
# Run our release
# TODO: Add foundry here
./node_modules/.bin/buildbranch "gh-pages" "dist"

# Open GitHub pages to verify
url="http://twolfson.github.io/khan-application/"
echo "Opening $url"
./node_modules/.bin/opener "$url"<commit_msg>Adding foundry release<commit_after>#!/usr/bin/env bash
# Stop at first error
set -e

# Grab the semver
semver="$1"
if test "$semver" = ""; then
  echo "Semver was not provided to \`release.sh\`. Please provide one" 1>&2
  echo "./release.sh <semver>" 1>&2
  exit 1
fi

# If we are on a dirty branch, stop
if test "$(git status --porcelain 2> /dev/null)" != ""; then
  echo "Current branch is dirty. Please stash or commit changes." 1>&2
  exit 1
fi

# Echo commands
set -x

# Build the latest (seems to dissapear when we use `buildbranch`)
./node_modules/.bin/grunt build

# DEV: We could use `npm-run-script` since as of 2.0, it supports variables
#   However, I am more familiar with `bash` for variable passing at the moment
# Run our release
./node_modules/.bin/foundry release "$semver"
./node_modules/.bin/buildbranch "gh-pages" "dist"

# Open GitHub pages to verify
url="http://twolfson.github.io/khan-application/"
echo "Opening $url"
./node_modules/.bin/opener "$url"
{'fraction_non_alphanumeric': 0.13201663201663202, 'fraction_numerical': 0.012474012474012475, 'mean_word_length': 3.718137254901961, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, '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': '2162047', 'n_tokens_mistral': 666, 'n_tokens_neox': 634, 'n_words': 252}