mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-19 00:17:51 +02:00
fix JC_COLORS env bug and simplify set_env_colors()
This commit is contained in:
@ -115,18 +115,17 @@ def set_env_colors():
|
||||
JC_COLORS=default,default,default,default
|
||||
|
||||
"""
|
||||
env_colors = os.getenv('JC_COLORS')
|
||||
input_error = False
|
||||
env_colors = os.getenv('JC_COLORS')
|
||||
|
||||
if env_colors:
|
||||
color_list = env_colors.split(',')
|
||||
else:
|
||||
color_list = ['default', 'default', 'default', 'default']
|
||||
|
||||
if len(color_list) != 4:
|
||||
input_error = True
|
||||
|
||||
if env_colors and len(color_list) != 4:
|
||||
input_error = True
|
||||
|
||||
if env_colors:
|
||||
for color in color_list:
|
||||
if color not in ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'gray', 'brightblack', 'brightred',
|
||||
'brightgreen', 'brightyellow', 'brightblue', 'brightmagenta', 'brightcyan', 'white', 'default']:
|
||||
|
Reference in New Issue
Block a user