Skip to content

Commit f541124

Browse files
authored
Merge pull request #90 from JonDum/patch-1
Fix install.sh, also try npm
2 parents 3b88595 + 5c5f746 commit f541124

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lib/install.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,15 @@ set -e
44

55
LIBDIR=$(cd $(dirname $0); pwd)
66

7-
yarn --cwd ${LIBDIR}
8-
ln -s "${LIBDIR}/node_modules/.bin/lehre" "${LIBDIR}/lehre"
7+
if [ -x "$(command -v yarn)" ]; then
8+
yarn --cwd "${LIBDIR}"
9+
ln -fs "${LIBDIR}/node_modules/.bin/lehre" "${LIBDIR}/lehre"
10+
elif [ -x "$(command -v npm)" ]; then
11+
cd "$LIBDIR"
12+
npm install
13+
ln -fs "${LIBDIR}/node_modules/.bin/lehre" "${LIBDIR}/lehre"
14+
else
15+
echo 'Neither yarn nor npm was found on your path' >&2
16+
exit 1
17+
fi
18+

0 commit comments

Comments
 (0)