Files
dotfiles/scripts/install-npm-packages.sh
2023-02-14 13:01:48 +02:00

27 lines
524 B
Bash
Executable File

#!/usr/bin/env zsh
# Install npm packages globally.
source "$HOME/.dotfiles/scripts/shared.sh"
if ! command -v npm &> /dev/null; then
msg_err "npm could not be found."
exit 1
fi
packages=(
# This is a tool to check if your files consider your .editorconfig rules.
"editorconfig-checker"
)
for pkg in "${packages[@]}"; do
# Trim spaces
pkg=${pkg// /}
# Skip comments
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
msg_run "Installing npm package:" "$pkg"
npm install -g --force "$pkg"
echo ""
done