#!/usr/bin/env bash

# Runs `npx` through Yarn if necessary so that the environment variables are set up similarly across
# Yarn and npm.

# shellcheck disable=SC2154
if [[ ! "$npm_config_user_agent" =~ yarn ]] && [ -x "$(command -v yarn)" ]; then
  yarn exec -- npx "$@"
else
  npx "$@"
fi
