#!/usr/bin/env bash

# Installs yarn if it isn't already installed.

set -euo pipefail

if ! hash yarn > /dev/null 2>&1; then
  curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
  echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
  sudo apt-get update
  sudo apt-get install --assume-yes yarn
fi
