mirror of
https://github.com/zhigang1992/graphql-engine.git
synced 2026-05-15 16:03:25 +08:00
adds a global flag `--skip-update-check`
This commit is contained in:
committed by
Shahidh K Muhammed
parent
199a24d050
commit
d489f2d90f
@@ -123,6 +123,9 @@ type ExecutionContext struct {
|
||||
|
||||
// LastUpdateCheckFile is the file where the timestamp of last update check is stored
|
||||
LastUpdateCheckFile string
|
||||
|
||||
// SkipUpdateCheck will skip the auto update check if set to true
|
||||
SkipUpdateCheck bool
|
||||
}
|
||||
|
||||
// NewExecutionContext returns a new instance of execution context
|
||||
|
||||
@@ -32,7 +32,7 @@ var rootCmd = &cobra.Command{
|
||||
ec.Telemetry.Command = cmd.CommandPath()
|
||||
|
||||
if cmd.Use != updateCLICmdUse {
|
||||
if update.ShouldRunCheck(ec.LastUpdateCheckFile) && ec.GlobalConfig.ShowUpdateNotification {
|
||||
if update.ShouldRunCheck(ec.LastUpdateCheckFile) && ec.GlobalConfig.ShowUpdateNotification && !ec.SkipUpdateCheck {
|
||||
u := &updateOptions{
|
||||
EC: ec,
|
||||
}
|
||||
@@ -68,7 +68,8 @@ func init() {
|
||||
rootCmd.SetHelpCommand(NewHelpCmd(ec))
|
||||
f := rootCmd.PersistentFlags()
|
||||
f.StringVar(&ec.LogLevel, "log-level", "INFO", "log level (DEBUG, INFO, WARN, ERROR, FATAL)")
|
||||
f.StringVar(&ec.ExecutionDirectory, "project", "", "directory where commands are executed. (default: current dir)")
|
||||
f.StringVar(&ec.ExecutionDirectory, "project", "", "directory where commands are executed (default: current dir)")
|
||||
f.BoolVar(&ec.SkipUpdateCheck, "skip-update-check", false, "Skip automatic update check on command execution")
|
||||
}
|
||||
|
||||
// Execute executes the command and returns the error
|
||||
|
||||
Reference in New Issue
Block a user