Refactor cmd setup and remove deadcode (#29313)

* use `setup(ctx, c.Bool("debug"))` like all other callers
* `setting.RunMode = "dev"` is a no-op.
* `if _, err := os.Stat(setting.RepoRootPath); err != nil` could be
simplified

(cherry picked from commit e9b13732f3d3b5536e43bdfdb5757dbbf484d694)
This commit is contained in:
wxiaoguang 2024-02-22 15:04:30 +08:00 committed by Earl Warren
parent 9debff3b71
commit 7906838669
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
2 changed files with 2 additions and 13 deletions

View file

@ -71,7 +71,7 @@ func runKeys(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
setup(ctx, false)
setup(ctx, c.Bool("debug"))
authorizedString, extra := private.AuthorizedPublicKeyByContent(ctx, content)
// do not use handleCliResponseExtra or cli.NewExitError, if it exists immediately, it breaks some tests like Test_CmdKeys