#!/usr/bin/env bash

# Installs the requeired version of node for puffin

set -euo pipefail
MIN_NODE_VERSION="v10"

if [[ $(node --version) != *${MIN_NODE_VERSION}* ]]; then
  curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
  sudo apt-get install -y nodejs
else
  echo "Node ${MIN_NODE_VERSION} already installed"
fi
