Skip to content

Commit 64b131b

Browse files
committed
Use proper boolean flags in click
1 parent 083e6d2 commit 64b131b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bin/lib/cli/environment.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ def environment_start(cfg: Config):
4646
help='While updating, ensure at least PERCENT are healthy', default=75, show_default=True)
4747
@click.option('--motd', type=str, default='Site is being updated',
4848
help='Set the message of the day used during refresh', show_default=True)
49-
@click.option('--no-notify', type=bool)
49+
@click.option('--notify/--no-notify', help='Send GitHub notifications for newly released PRs', default=True)
5050
@click.pass_obj
51-
def environment_refresh(cfg: Config, min_healthy_percent: int, motd: str, no_notify: bool):
51+
def environment_refresh(cfg: Config, min_healthy_percent: int, motd: str, notify: bool):
5252
"""Refreshes an environment.
5353
5454
This replaces all the instances in the ASGs associated with an environment with
@@ -102,7 +102,7 @@ def environment_refresh(cfg: Config, min_healthy_percent: int, motd: str, no_not
102102
last_log = log
103103
if status in ('Successful', 'Failed', 'Cancelled'):
104104
break
105-
if cfg.env.value == cfg.env.PROD and not no_notify: # Double negation because I don't know how to make a default cli flag be True
105+
if cfg.env.value == cfg.env.PROD and notify:
106106
current_notify = get_current_notify()
107107
if current_notify is not None and current_release is not None:
108108
gh_token = get_ssm_param("/compiler-explorer/githubAuthToken")

0 commit comments

Comments
 (0)