Skip to content

Commit

Permalink
Added Deprecate Property to Watch Flag (Issue #3256) (#3440)
Browse files Browse the repository at this point in the history
* added deprecate to watch flag

* added deprecate warning to logs

* fixed error, set check for watch flag properly

* fixed error, set check for watch flag properly

* logged warnign with Warnf
  • Loading branch information
abdullahzameek committed Jun 12, 2020
1 parent c5f015c commit 329e43f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/cli/up.go
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 {
logger.Get(ctx).Warnf("Flag --watch has been deprecated, it will be removed in future releases.")
}

if ok, reason := analytics.IsAnalyticsDisabledFromEnv(); ok {
log.Printf("Tilt analytics disabled: %s", reason)
}
Expand Down

0 comments on commit 329e43f

Please sign in to comment.