<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

git pull
cd server
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
  mv ./pageshot.xpi dist/
  mv ./pageshot.update.rdf dist/
fi
mv dist-production dist-production.obsolete
mv dist dist-production
rm -r dist-production.obsolete
sudo service pageshot restart<commit_msg>Add nvm use to make npm work<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

nvm use 0.12
git pull
cd server
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
  mv ./pageshot.xpi dist/
  mv ./pageshot.update.rdf dist/
fi
mv dist-production dist-production.obsolete
mv dist dist-production
rm -r dist-production.obsolete
sudo service pageshot restart
{'fraction_non_alphanumeric': 0.10176991150442478, 'fraction_numerical': 0.007964601769911504, 'mean_word_length': 2.9964664310954063, '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': '768000', 'n_tokens_mistral': 422, 'n_tokens_neox': 398, 'n_words': 146}