Merge pull request #6 from wolfv/fix_dry_run

fix nice dry run printing
This commit is contained in:
Wolf Vollprecht 2019-03-25 16:29:58 +01:00 committed by GitHub
commit 913ae26568
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 21 deletions

View File

@ -230,26 +230,7 @@ def do_call(args, parser):
return 0
return exit_code
# Main entry point!
def main(*args, **kwargs):
print(banner)
if 'activate' in sys.argv or 'deactivate' in sys.argv:
print("Use conda to activate / deactivate the environment.")
print('\n $ conda ' + ' '.join(sys.argv[1:]) + '\n')
return sys.exit(-1)
from conda.common.compat import ensure_text_type, init_std_stream_encoding
init_std_stream_encoding()
if not args:
args = sys.argv
args = tuple(ensure_text_type(s) for s in args)
def _wrapped_main(*args, **kwargs):
if len(args) == 1:
args = args + ('-h',)
@ -262,4 +243,24 @@ def main(*args, **kwargs):
# from .conda_argparse import do_call
exit_code = do_call(args, p)
if isinstance(exit_code, int):
return exit_code
return exit_code
# Main entry point!
def main(*args, **kwargs):
from conda.common.compat import ensure_text_type, init_std_stream_encoding
init_std_stream_encoding()
print(banner)
if 'activate' in sys.argv or 'deactivate' in sys.argv:
print("Use conda to activate / deactivate the environment.")
print('\n $ conda ' + ' '.join(sys.argv[1:]) + '\n')
return sys.exit(-1)
if not args:
args = sys.argv
args = tuple(ensure_text_type(s) for s in args)
from conda.exceptions import conda_exception_handler
return conda_exception_handler(_wrapped_main, *args, **kwargs)