Skip to content

Commit

Permalink
Fix news gen tasks
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Ryan <[email protected]>
  • Loading branch information
techalchemy committed Jun 16, 2018
1 parent ebadcb7 commit b983834
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tasks/news.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ def add(ctx, description, type_='feature', issue=None):
target_dir = _get_news_dir(ctx)
existing_files = [f.suffix.split('-')[0] for f in target_dir.glob('{0}.*'.format(type_)) if f.suffix.split('-')[0].isdigit()]
if not existing_files and not issue:
nextfile = target_dir / '1-{0}.{1}'.format(type_, get_random())
nextfile = target_dir / '1-{0}.{1}'.format(get_random(), type_)
elif issue:
nextfile = target_dir / '{0}.{1}'.format(issue, type_)
else:
nextfile = '{0}-{1}.{2}'.format(type_, int(sorted(existing_files).pop()) + 1, get_random())
nextfile = '{0}-{1}.{2}'.format(int(sorted(existing_files).pop()) + 1, get_random(), type_)
nextfile = target_dir / nextfile
print("[news.add] Adding newsfile {0} => [{1}] {2}".format(nextfile.name, type_.upper(), description))
nextfile.write_text(description)
Expand Down

0 comments on commit b983834

Please sign in to comment.