<commit_before>#!/usr/bin/env sh

nodeMinVersion="v6.0.0"
npmMinVersion="3.0.0"

if [[ $(node --version) < $nodeMinVersion ]]; then
  echo 'You need node >= 6'
  exit 0
fi

if [[ $(npm --version) < $npmMinVersion ]]; then
  echo 'You need npm >= 3'
  exit 0
fi

if pgrep peertube > /dev/null; then
  echo 'PeerTube is running!'
  exit 0
fi

git pull origin $(git rev-parse --abbrev-ref HEAD) || exit -1

npm install
npm update
cd client && npm update && cd ../
npm run build

echo "\n\nUpgrade finished! You can restart PeerTube that may run the migration scripts."<commit_msg>Add yarn to npm run upgrade<commit_after>#!/usr/bin/env sh

nodeMinVersion="v6.0.0"
npmMinVersion="3.0.0"

if [[ $(node --version) < $nodeMinVersion ]]; then
  echo 'You need node >= 6'
  exit 0
fi

if [[ $(npm --version) < $npmMinVersion ]]; then
  echo 'You need npm >= 3'
  exit 0
fi

if ! which yarn > /dev/null; then
  echo 'You need yarn'
  exit 0
fi

if pgrep peertube > /dev/null; then
  echo 'PeerTube is running!'
  exit 0
fi

git pull origin $(git rev-parse --abbrev-ref HEAD) || exit -1

yarn install
yarn update
cd client && yarn update && cd ../
npm run build

echo "\n\nUpgrade finished! You can restart PeerTube that may run the migration scripts."
{'fraction_non_alphanumeric': 0.13456889605157132, 'fraction_numerical': 0.020145044319097503, 'mean_word_length': 3.2975778546712804, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 10, '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': '6156621', 'n_tokens_mistral': 474, 'n_tokens_neox': 434, 'n_words': 168}