aboutsummaryrefslogtreecommitdiffstats
path: root/.functions
diff options
context:
space:
mode:
authorSindre Sorhus <sindresorhus@gmail.com>2013-10-22 17:22:37 +0200
committerMathias Bynens <mathias@qiwi.be>2013-10-22 18:11:42 +0200
commit565955198f6c627197cdd24cb26cb72cc0b2673a (patch)
tree22acbdbccead65b1b99584e76d8f14be3f2e6c4c /.functions
parent6c98b40f4d9b692863e4e58cfcb355058d5b8544 (diff)
downloaddotfiles-565955198f6c627197cdd24cb26cb72cc0b2673a.tar.gz
dotfiles-565955198f6c627197cdd24cb26cb72cc0b2673a.tar.bz2
dotfiles-565955198f6c627197cdd24cb26cb72cc0b2673a.zip
Add `np` function to ease publishing node modules
I use this to ease the publishing of npm modules. `np`, done ;) np = npm publish (and, `no problem`, (and `nutella party`)) Closes #261.
Diffstat (limited to '.functions')
-rw-r--r--.functions12
1 files changed, 12 insertions, 0 deletions
diff --git a/.functions b/.functions
index 4a1e407..79255f1 100644
--- a/.functions
+++ b/.functions
@@ -291,3 +291,15 @@ function o() {
open "$@"
fi
}
+
+# `np` with an optional argument `patch`/`minor`/`major`/`<version>`
+# defaults to `patch`
+function np() {
+ git pull --rebase && \
+ npm install && \
+ npm test && \
+ npm version ${1:=patch} && \
+ npm publish && \
+ git push origin master && \
+ git push origin master --tags
+}