Skip to content

Commit

Permalink
Add a flag to skip profile registry sync
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaWilkes committed Nov 11, 2024
1 parent a21b3a0 commit f04c873
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/assume/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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."},
}
}

Expand Down Expand Up @@ -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" {
Expand Down

0 comments on commit f04c873

Please sign in to comment.