-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall_javascript.sh
More file actions
executable file
·38 lines (30 loc) · 953 Bytes
/
Copy pathinstall_javascript.sh
File metadata and controls
executable file
·38 lines (30 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
set -euo pipefail
test -z ${DEBUG:-} || set -x
uname=$(uname -s | tr "[:upper:]" "[:lower:]")
DOTFILES_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
if [[ $uname == linux ]]; then
exit 0
fi
# This script installs JavaScript and several tools in the JavaScript ecosystem.
echo "Installing JavaScript and friends"
. $DOTFILES_DIR/functions.sh
if [[ $uname == linux ]]; then
curl -fsSL https://github.com/nodenv/nodenv-installer/raw/HEAD/bin/nodenv-installer | bash
else
install_now nodenv
fi
# Modern way to install yarn
corepack enable
latest=$(\
nodenv install --list 2>/dev/null | \
sed -n '/^[[:space:]]*[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}[[:space:]]*$/ h;${g;p;}' \
)
nodenv install --skip-existing $latest
nodenv global $latest
install_now npm
npm install -g \
bower `# package manager` \
prettier `# code formatter` \
prettier-plugin-go-template `# format go templates in HTML` \
typescript `# typed JavaScript`