Permalink
Browse files

Add "npm_publish" alias to help with tagging pre-release versions.

  • Loading branch information...
1 parent 9d27777 commit eea5ae81af35575f9d593d577ae4a0bf48c613c4 @cowboy committed Jul 25, 2012
Showing with 13 additions and 0 deletions.
  1. +13 −0 source/50_devel.sh
View
@@ -25,6 +25,19 @@ function nave_stable_2() {
fi
}
+# Publish module to Npm registry, but don't update "latest" unless the version
+# is an actual release version!
+function npm_publish() {
+ local version="$(node -pe 'require("./package.json").version' 2>/dev/null)"
+ if [[ "${version#v}" =~ [a-z] ]]; then
+ echo "Publishing dev version $version with --tag=devel"
+ npm publish --tag=devel "$@"
+ else
+ echo "Publishing new latest version $version"
+ npm publish "$@"
+ fi
+}
+
# rbenv init.
PATH=$(path_remove ~/.dotfiles/libs/rbenv/bin):~/.dotfiles/libs/rbenv/bin
PATH=$(path_remove ~/.dotfiles/libs/ruby-build/bin):~/.dotfiles/libs/ruby-build/bin

0 comments on commit eea5ae8

Please sign in to comment.