diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-08-24 12:49:50 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-08-24 12:49:50 -0400 |
commit | 59c4ce802ac78c7f845250a8e0c10210b6283800 (patch) | |
tree | 1f6130eec5c3fbc71f7d4651ae67384382c20b05 | |
parent | 8c0abd3c1adb204737851c06cb9eeba16791f2c4 (diff) | |
download | cmd2-git-59c4ce802ac78c7f845250a8e0c10210b6283800.tar.gz |
Added a tag invoke task for adding a Git tag and pushing it to origin
-rw-r--r-- | tasks.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -173,6 +173,15 @@ def clean_all(context): pass namespace_clean.add_task(clean_all, 'all') +@invoke.task +def tag(context, name='', message=''): + "Add a Git tag and push it to origin" + # If a tag was provided on the command-line, then add a Git tag and push it to origin + if name: + context.run('git tag -a {} -m {!r}'.format(name, message)) + context.run('git push origin {}'.format(name)) +namespace.add_task(tag) + @invoke.task(pre=[clean_all]) def sdist(context): "Create a source distribution" |