Permalink
Browse files

made version make sense

  • Loading branch information...
1 parent 88c5424 commit ab7359bf75c67caf2d2fc514e4f5f00b31e674a5 @NorthIsUp committed Feb 10, 2012
Showing with 21 additions and 22 deletions.
  1. +0 −4 Markdown.sublime-build
  2. +2 −2 messages.json
  3. +1 −1 package-metadata.json
  4. +18 −15 pavement.py
View
4 Markdown.sublime-build
@@ -1,4 +0,0 @@
-{
- "osx": { "cmd": ["open", "-a", "Mou", "$file"] },
- "selector": "text.html.markdown"
-}
View
4 messages.json
@@ -1,6 +1,6 @@
{
"14": "added a messages.json file",
"16": "Some sort of awesome change!",
- "16-1-g719354f-17": "Some sort of awesome change!",
+ "18": "Some sort of awesome change!",
"latest": "Some sort of awesome change!"
-}
+}
View
2 package-metadata.json
@@ -1,5 +1,5 @@
{
"description": "Block selection toggle and other tools that I missed from other editors",
"url": "https://github.com/NorthIsUp/Sublimation",
- "version": "16-1-g719354f-17"
+ "version": "18"
}
View
33 pavement.py
@@ -1,10 +1,11 @@
-import os
from paver.easy import *
from paver.path import path
from paver.setuputils import setup
import simplejson as json
sublimation_dir = path(__file__).dirname().abspath()
+metadata_file = path(sublimation_dir + "/package-metadata.json")
+messages_file = path(sublimation_dir + "/messages.json")
setup(
name="Sublimation",
@@ -46,15 +47,21 @@ def html():
@task
-def bump_rev():
- """Bump the revision as a part of distribution"""
- revision_count = sh("git log --oneline --all | wc -l", capture=True,).strip()
- project_version = sh("git describe --tags --long", capture=True).strip()
+def test():
+ """run all unit tests"""
+ pass
- version = "-".join((project_version, revision_count))
- metadata_file = path(sublimation_dir + "/package-metadata.json")
- messages_file = path(sublimation_dir + "/messages.json")
+@task
+@cmdopts([
+ ('message=', 'm', 'Message for messages file')
+ ])
+def bump_rev(options):
+ """--message=[msg] Bump the revision as a part of distribution"""
+ if not hasattr(options, 'message'):
+ raise Exception("requires --message")
+
+ version = sh("git log --oneline --all | wc -l", capture=True,).strip()
metadata = json.loads(metadata_file.text())
metadata['version'] = version
@@ -69,15 +76,11 @@ def bump_rev():
messages['latest'] = "Some sort of awesome change!"
messages_file.write_text(json.dumps(messages, indent=4, sort_keys=True))
- print version
- # _git_amend() # save the new version number
- # _git_tag(metadata['version'])
-
@task
-def test():
- """run all unit tests"""
- pass
+def tag():
+ metadata = json.loads(metadata_file.text())
+ _git_tag(metadata['version'])
@task

0 comments on commit ab7359b

Please sign in to comment.