<commit_before>#!/usr/bin/env bash
#
# Node package manager (NPM)

set -e

NODE_VERSION="4.6.0"

# Check for nodenv and install if it’s not installed
if [ ! -d $HOME/.nodenv/bin ] ; then
  echo ""
  echo "  √ nodenv not found. Installing now..."
  echo ""
  git clone https://github.com/nodenv/nodenv.git $HOME/.nodenv
  echo ""
  echo "  √ Reloading environment"
  echo ""
  export PATH=$HOME/.nodenv/bin:$PATH
  eval "$(nodenv init -)"
  echo ""
  echo "  √ Installing node-build plugin..."
  echo ""
  git clone https://github.com/nodenv/node-build.git $HOME/.nodenv/plugins/node-build
  echo ""
  echo "  √ Installing nodenv-update plugin..."
  echo ""
  git clone https://github.com/nodenv/nodenv-update.git $HOME/.nodenv/plugins/nodenv-update
  echo ""
  echo "  √ Attempting to compile dynamic extensions..."
  echo ""
  set +e
  cd $HOME/.nodenv && src/configure && make -C src
  set -e
  echo ""
  echo "  √ Installing node version $NODE_VERSION..."
  echo ""
  nodenv install $NODE_VERSION
  echo ""
  echo "  √ Setting global Node version to $NODE_VERSION"
  echo ""
  nodenv global $NODE_VERSION
else
  echo ""
  echo "  √ Looks like nodenv is installed. Awesome!"
  echo ""
fi

# Cache list of already installed global packages
if command -v npm >/dev/null 2>&1 ; then
  INSTALLED_PACKAGES=( $(find `npm root -g` -type d -maxdepth 1 -not -path '*/\.*' -print0 | while IFS= read -r -d '' dirname; do echo ${dirname##*/}; done) )
fi

# Packages to install globally
PACKAGES=(
  "autoprefixer"
  "bower"
  "csscomb"
  "eslint"
  "grunt"
  "gulp"
  "http-server"
  "live-server"
  "localtunnel"
  "nodemon"
  "npm-check-updates"
  "stylelint"
  "svgo"
)

echo "  √ Running Node install script"
echo ""

# Check for npm if we’re on OS X
if command -v npm >/dev/null 2>&1 ; then
  echo "  √ Looks like npm is installed. Checking for packages to install."
  # Install npm packages globally
  for PACKAGE in ${PACKAGES[@]} ; do
    if ! echo ${INSTALLED_PACKAGES[@]} | grep -q "${PACKAGE}" ; then
      npm install -g $PACKAGE
    fi<commit_msg>Move package list for Node<commit_after>#!/usr/bin/env bash
#
# Node package manager (NPM)

set -e

NODE_VERSION="4.6.0"

# Packages to install globally
PACKAGES=(
  "autoprefixer"
  "bower"
  "csscomb"
  "eslint"
  "grunt"
  "gulp"
  "http-server"
  "live-server"
  "localtunnel"
  "nodemon"
  "npm-check-updates"
  "stylelint"
  "svgo"
)

# Check for nodenv and install if it’s not installed
if [ ! -d $HOME/.nodenv/bin ] ; then
  echo ""
  echo "  √ nodenv not found. Installing now..."
  echo ""
  git clone https://github.com/nodenv/nodenv.git $HOME/.nodenv
  echo ""
  echo "  √ Reloading environment"
  echo ""
  export PATH=$HOME/.nodenv/bin:$PATH
  eval "$(nodenv init -)"
  echo ""
  echo "  √ Installing node-build plugin..."
  echo ""
  git clone https://github.com/nodenv/node-build.git $HOME/.nodenv/plugins/node-build
  echo ""
  echo "  √ Installing nodenv-update plugin..."
  echo ""
  git clone https://github.com/nodenv/nodenv-update.git $HOME/.nodenv/plugins/nodenv-update
  echo ""
  echo "  √ Attempting to compile dynamic extensions..."
  echo ""
  set +e
  cd $HOME/.nodenv && src/configure && make -C src
  set -e
  echo ""
  echo "  √ Installing node version $NODE_VERSION..."
  echo ""
  nodenv install $NODE_VERSION
  echo ""
  echo "  √ Setting global Node version to $NODE_VERSION"
  echo ""
  nodenv global $NODE_VERSION
else
  echo ""
  echo "  √ Looks like nodenv is installed. Awesome!"
  echo ""
fi

# Cache list of already installed global packages
if command -v npm >/dev/null 2>&1 ; then
  INSTALLED_PACKAGES=( $(find `npm root -g` -type d -maxdepth 1 -not -path '*/\.*' -print0 | while IFS= read -r -d '' dirname; do echo ${dirname##*/}; done) )
fi

echo "  √ Running Node install script"
echo ""

# Check for npm if we’re on OS X
if command -v npm >/dev/null 2>&1 ; then
  echo "  √ Looks like npm is installed. Checking for packages to install."
  # Install npm packages globally
  for PACKAGE in ${PACKAGES[@]} ; do
    if ! echo ${INSTALLED_PACKAGES[@]} | grep -q "${PACKAGE}" ; then
      npm install -g $PACKAGE
    fi
{'fraction_non_alphanumeric': 0.1424750790177486, 'fraction_numerical': 0.00437636761487965, 'mean_word_length': 2.9903006789524733, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 6, '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': '5167690', 'n_tokens_mistral': 1481, 'n_tokens_neox': 1444, 'n_words': 469}