aboutsummaryrefslogtreecommitdiff
path: root/installer/npm_install.sh
blob: 198666cac2a827db8600a36953e4344b5b9f93c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

# Usage
# $ npm_install [EXECUTABLE_NAME] [NPM_NAME]

set -e

npm init -y

# Avoid the problem of not being able to install the same package as name in package.json.
# Create an empty package.json.
cat <<EOF >package.json
{"name": ""}
EOF

npm install "$2"
ln -s "./node_modules/.bin/$1" .