Commits

Miki Tebeka  committed 51c01c4

Better push

  • Participants
  • Parent commits f20e526

Comments (0)

Files changed (1)

 #!/bin/bash
-# Push new version to clojars.org
+# Push to clojars
 
 set -x
+set -e
 
+if [ ! -f project.clj ]; then
+    echo "error: can't find project.clj" 1>&2
+    exit 1
+fi
+
+project=$(grep defproject project.clj | awk '{print $2}')
+version=$(egrep -o "[0-9]+\.[0-9]+\.[0-9]+(-SNAPSHOT)?" project.clj  | head -1)
+jar=$project-${version}.jar
+
+if [ -f $jar ]; then
+    rm $jar
+fi
 lein jar
 lein pom
-scp pom.xml digest-*.jar clojars@clojars.org:
+scp pom.xml $jar clojars@clojars.org:
+rm pox.xml $jar