Files
compiler-explorer/etc/scripts/find-yarn
T
Ruslan Garipov 42c9b269f0 Make ``find'' scripts compatible w/ the Bourne sh
By default FreeBSD does not have the Bourne-again shell (Bash)
installed.  Therefore, the system fails to execute two ``find'' scripts
(etc/scripts/find-node and etc/scripts/find-yarn) running by the
Makefile within the `.node-bin` and `.yarn-bin` targets.

I see nothing Bash-specific in those scripts.  Also I believe that
`[[ expression ]]` commands in those particular cases can be safely
replaced with the `test` built-in commands.

With these changes I can now run a local ``Compiler explorer'' instance
on FreeBSD.

Signed-off-by: Ruslan Garipov <ruslanngaripov@gmail.com>
2019-01-31 20:24:00 +05:00

15 lines
234 B
Bash
Executable File

#!/bin/sh
set -e
OUT="$1"
YARN=$(pwd)/node_modules/.bin/yarn
if test ! -x "${YARN}"; then
# Ensure any npm output goes to stderr and doesn't affect our
# echo output below
>&2 npm install yarn
fi
echo ${YARN} > ${OUT}