Permalink
Browse files

Automatically git push on cake publish

  • Loading branch information...
assaf committed Feb 18, 2011
1 parent f53a4db commit cffd7ac7d46c4eed7d14ae49122a4eb0f2483d7e
Showing with 20 additions and 18 deletions.
  1. +20 −18 Cakefile
View
@@ -197,27 +197,29 @@ task "publish", "Publish new version (Git, NPM, site)", ->
# scratch, don't want generated files we no longer use, etc.
clean (err)->
onerror err
- fs.readFile "package.json", "utf8", (err, package)->
- package = JSON.parse(package)
-
- # Publish documentation, need these first to generate man pages,
- # inclusion on NPM package.
- generateDocs (err)->
- onerror err
+ exec "git push", (err)->
+ onerror err
+ fs.readFile "package.json", "utf8", (err, package)->
+ package = JSON.parse(package)
- log "Publishing to NPM ...", green
- build (err)->
+ # Publish documentation, need these first to generate man pages,
+ # inclusion on NPM package.
+ generateDocs (err)->
onerror err
- exec "npm publish", (err, stdout, stderr)->
- log stdout, green
- onerror err
- # Create a tag for this version and push changes to Github.
- log "Tagging v#{package.version} ...", green
- exec "git tag v#{package.version}", (err, stdout, stderr)->
+ log "Publishing to NPM ...", green
+ build (err)->
+ onerror err
+ exec "npm publish", (err, stdout, stderr)->
log stdout, green
- exec "git push --tags origin master", (err, stdout, stderr)->
+ onerror err
+
+ # Create a tag for this version and push changes to Github.
+ log "Tagging v#{package.version} ...", green
+ exec "git tag v#{package.version}", (err, stdout, stderr)->
log stdout, green
+ exec "git push --tags origin master", (err, stdout, stderr)->
+ log stdout, green
- # We can do this in parallel.
- publishDocs onerror
+ # We can do this in parallel.
+ publishDocs onerror

0 comments on commit cffd7ac

Please sign in to comment.