Skip to content

Commit

Permalink
Sort authors/maintainers for correct email assignment (#492)
Browse files Browse the repository at this point in the history
The PackageTemplate class internally sorts the authors and maintainers
by their names.  To ensure that email addresses are later assigned to
the correct names, also sort them in the main function.
  • Loading branch information
luator authored and mikepurvis committed Mar 13, 2018
1 parent 3ead0cb commit cd12a13
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions catkin_tools/verbs/catkin_create/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ def main(opts):
try:
# Get absolute path to directory containing package
package_dest_path = os.path.abspath(opts.path)

# Sort list of maintainers and authors (it will also be sorted inside
# PackageTemplate so by sorting it here, we ensure that the same order
# is used. This is important later when email addresses are assigned.
if opts.maintainers:
opts.maintainers.sort(key=lambda x: x[0])
if opts.authors:
opts.authors.sort(key=lambda x: x[0])

for package_name in opts.name:
print('Creating package "%s" in "%s"...' % (package_name, package_dest_path))
target_path = os.path.join(package_dest_path, package_name)
Expand Down

0 comments on commit cd12a13

Please # to comment.