Add 'dots/' from commit 'f64b634dd8fbb2c8a2898c3b9d0acc9452e4d966'
git-subtree-dir: dots git-subtree-mainline:2ad98cde17git-subtree-split:f64b634dd8
This commit is contained in:
35
dots/.bash_aliases/lang-js
Normal file
35
dots/.bash_aliases/lang-js
Normal file
@@ -0,0 +1,35 @@
|
||||
# shellcheck shell=bash
|
||||
# vim: set ft=bash :
|
||||
|
||||
alias js="node"
|
||||
alias ts="ts-node"
|
||||
|
||||
yarn() {
|
||||
if [[ -f "package-lock.json" ]]; then
|
||||
echo "WARNING: package-lock.json exists"
|
||||
read -p "Are you sure you want to run yarn? [y/N] " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
command yarn "$@"
|
||||
else
|
||||
echo "Aborted"
|
||||
fi
|
||||
else
|
||||
command yarn "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
npm() {
|
||||
if [[ -f "yarn.lock" ]]; then
|
||||
echo "WARNING: yarn.lock exists"
|
||||
read -p "Are you sure you want to run npm? [y/N] " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
command npm "$@"
|
||||
else
|
||||
echo "Aborted"
|
||||
fi
|
||||
else
|
||||
command npm "$@"
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user