-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.sh
31 lines (26 loc) · 880 Bytes
/
functions.sh
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
# for things that don't work as aliases and scripts (i.e. need to run in the *current* shell)
function pbr(){
cd ~/src/piggyback/$1
}
function _pbr(){
local cur=${COMP_WORDS[COMP_CWORD]};
COMPREPLY=( $(compgen -W "$(/bin/ls ~/src/piggyback/)" -- $cur));
}
complete -o nospace -F _pbr pbr
new-node() {
if [[ -z $1 ]]; then
echo "ERROR: Please provide a project name"
return 1
fi
mkdir $1
cd $1
npm init -f
perl -pi -e '$_ .= qq( "private": true,\n) if /"description":/' package.json
npm install --save -E bluebird csv lodash yargs
npm install --save-dev @scoop/eslint-config-scoop eslint@3 eslint-plugin-dependencies@2
echo -e 'node_modules/' > .gitignore
echo -e '{\n "extends": "@scoop/eslint-config-scoop"\n}' > .eslintrc.json
git init
git add .gitignore package.json .eslintrc.json
git commit -m "scaffolded project"
}