Skip to content

Commit

Permalink
Improve new_version handling and exempt test and upload from version …
Browse files Browse the repository at this point in the history
…prompting
  • Loading branch information
michaeljoseph committed Sep 7, 2013
1 parent dd346c2 commit 38c9546
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions changes/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,21 +285,26 @@ def main():
debug = arguments['--debug']
logging.basicConfig(level=logging.DEBUG if debug else logging.INFO)

suppress_version_prompt_for = ['test', 'upload']

app_name = arguments['<app_name>']

if arguments['--new-version']:
new_version = arguments['--new-version']
else:
new_version = get_new_version(
app_name,
current_version(app_name),
**dict([
(key[2:], value) for key, value in extract(arguments, ['--major', '--minor', '--patch']).items()
])
)
arguments['new_version'] = arguments['--new-version']

arguments['new_version'] = new_version
log.debug('arguments: %s', arguments)
for command in ['release', 'version', 'changelog', 'tag', 'upload']:

for command in commands:
if arguments[command]:
if command not in suppress_version_prompt_for:
arguments['new_version'] = get_new_version(
app_name,
current_version(app_name),
**dict([
(key[2:], value)
for key, value in
extract(arguments, ['--major', '--minor', '--patch'])
.items()
])
)
globals()[command](arguments)

0 comments on commit 38c9546

Please sign in to comment.