-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Deprecate Property to Watch Flag (Issue #3256) #3440
Changes from 4 commits
6de7859
c3ae1b6
8ee678d
83e3b2d
65d7132
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,9 @@ type upCmd struct { | |
hud bool | ||
// whether hud was explicitly set or just got the default value | ||
hudFlagExplicitlySet bool | ||
|
||
//whether watch was explicitly set in the cmdline | ||
watchFlagExplicitlySet bool | ||
} | ||
|
||
func (c *upCmd) register() *cobra.Command { | ||
|
@@ -98,6 +101,7 @@ local resources--i.e. those using serve_cmd--are terminated when you exit Tilt. | |
|
||
cmd.PreRun = func(cmd *cobra.Command, args []string) { | ||
c.hudFlagExplicitlySet = cmd.Flag("hud").Changed | ||
c.watchFlagExplicitlySet = cmd.Flag("watch").Changed | ||
} | ||
|
||
return cmd | ||
|
@@ -136,6 +140,11 @@ func (c *upCmd) run(ctx context.Context, args []string) error { | |
|
||
logOutput(fmt.Sprintf("Starting Tilt (%s)…", buildStamp())) | ||
|
||
//if --watch was set, warn user about deprecation | ||
if c.watchFlagExplicitlySet { | ||
logOutput("Flag --watch has been deprecated, it will be removed in future releases.") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fyi, i think you can also use logger.Get(ctx).Warnf(...) if you want it to show up as a warning in the UI There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep! it has the yellow UI bar in the web, and skips the prefix |
||
} | ||
|
||
if ok, reason := analytics.IsAnalyticsDisabledFromEnv(); ok { | ||
log.Printf("Tilt analytics disabled: %s", reason) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice solution!