Skip to content

Commit

Permalink
Print conda config --get list items in reverse order
Browse files Browse the repository at this point in the history
This will not match the order in the rc file, but it will make it so that
adding the printed options in the same order will recreate the same order as
the rc file.
  • Loading branch information
asmeurer committed Jul 16, 2013
1 parent 68f5ab2 commit 524df1d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion conda/cli/main_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ def execute(args, parser):
if isinstance(rc_config[key], bool):
print "--set", key, rc_config[key]
else:
for item in rc_config.get(key, []):
# Note, since conda config --add prepends, these are printed in
# the reverse order so that entering them in this order will
# recreate the same file
for item in reversed(rc_config.get(key, [])):
# Use repr so that it can be pasted back in to conda config --add
print "--add", key, repr(item)

Expand Down

0 comments on commit 524df1d

Please sign in to comment.