From f04c8732faacc40c098aa5c5830a390a74d4e88b Mon Sep 17 00:00:00 2001 From: JoshuaWilkes <14214200+JoshuaWilkes@users.noreply.github.com> Date: Mon, 11 Nov 2024 11:28:09 +0800 Subject: [PATCH] Add a flag to skip profile registry sync --- pkg/assume/entrypoint.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/assume/entrypoint.go b/pkg/assume/entrypoint.go index a3c7cbf9..d7817844 100644 --- a/pkg/assume/entrypoint.go +++ b/pkg/assume/entrypoint.go @@ -57,6 +57,7 @@ func GlobalFlags() []cli.Flag { &cli.BoolFlag{Name: "wait", Usage: "When using Granted with Common Fate the assume will halt while waiting for the access request to be approved."}, &cli.BoolFlag{Name: "no-cache", Usage: "Disables caching of session credentials and forces a refresh", EnvVars: []string{"GRANTED_NO_CACHE"}}, &cli.StringSliceFlag{Name: "browser-launch-template-arg", Usage: "Additional arguments to provide to the browser launch template command in key=value format, e.g. '--browser-launch-template-arg foo=bar"}, + &cli.BoolFlag{Name: "skip-profile-registry-sync", Usage: "You can use this to skip the automated profile registry sync process."}, } } @@ -140,8 +141,13 @@ func GetCliApp() *cli.App { // terminates the command with os.exit(0) browser.GrantedIntroduction() } - // Sync granted profile registries if enabled - autosync.Run(c.Context, true) + + if !c.Bool("skip-profile-registry-sync") { + // Sync granted profile registries if enabled + autosync.Run(c.Context, true) + } else { + clio.Debug("skipping profile registry sync because --skip-profile-registry-sync flag was true") + } // Setup the shell alias if os.Getenv("FORCE_NO_ALIAS") != "true" {