Permalink
Browse files

Handle malformed version tags when uploading to Marmalade

e.g. 1.3.3beta1
  • Loading branch information...
1 parent ac49679 commit f89f832a8df4bba17fb0a8a115a5fb94baf2a3d4 @purcell committed Mar 11, 2013
Showing with 8 additions and 1 deletion.
  1. +8 −1 init-marmalade.el
View
@@ -4,8 +4,15 @@
(autoload 'marmalade-upload-buffer "marmalade")
+(defun sanityinc/parse-git-version (s)
+ "Return numeric version array parsed from S, or nil."
+ (ignore-errors (version-to-list s)))
+
(defun latest-version-from-git-tag ()
- (let ((versions (mapcar #'version-to-list (split-string (shell-command-to-string "git tag")))))
+ (let ((versions
+ (remove-if #'null
+ (mapcar #'sanityinc/parse-git-version
+ (split-string (shell-command-to-string "git tag"))))))
(sort versions #'version-list-<)
(package-version-join (car (last versions)))))

0 comments on commit f89f832

Please sign in to comment.