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

if [ ! -e .git ] ; then
  echo "Error: $0 must be run from the root of the pageshot checkout"
  exit 3
fi

export NVM_DIR="/home/ubuntu/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm
nvm use 0.12
git pull
npm install
gulp transforms
if [ -e ./pageshot.xpi ] ; then
  echo "Updating XPI"
  if [ ! -e ./pageshot.update.rdf ] ; then
    echo "Missing pageshot.update.rdf"
    exit 2
  fi
  mkdir -p server/dist/xpi
  mv ./pageshot.xpi server/dist/xpi/
  mv ./pageshot.update.rdf server/dist/xpi/
fi
mv server/dist-production server/dist-production.obsolete
mv server/dist server/dist-production
rm -r server/dist-production.obsolete
sudo service pageshot restart<commit_msg>update addon/lib/shot.js for the server (until shared directory is put in place)<commit_after>#!/usr/bin/env bash
set -e

if [ ! -e .git ] ; then
  echo "Error: $0 must be run from the root of the pageshot checkout"
  exit 3
fi

export NVM_DIR="/home/ubuntu/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm
nvm use 0.12
git pull
npm install
gulp lib-addon transforms
if [ -e ./pageshot.xpi ] ; then
  echo "Updating XPI"
  if [ ! -e ./pageshot.update.rdf ] ; then
    echo "Missing pageshot.update.rdf"
    exit 2
  fi
  mkdir -p server/dist/xpi
  mv ./pageshot.xpi server/dist/xpi/
  mv ./pageshot.update.rdf server/dist/xpi/
fi
mv server/dist-production server/dist-production.obsolete
mv server/dist server/dist-production
rm -r server/dist-production.obsolete
sudo service pageshot restart
{'fraction_non_alphanumeric': 0.12475884244372991, 'fraction_numerical': 0.0077170418006430866, 'mean_word_length': 3.1493333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3057521', 'n_tokens_mistral': 607, 'n_tokens_neox': 575, 'n_words': 173}