mirror of
https://github.com/livekit/livekit.git
synced 2026-08-29 07:39:09 +00:00
baseFlags do not need to be set (#1127)
This commit is contained in:
@@ -473,8 +473,8 @@ func (conf *Config) updateFromCLI(c *cli.Context, baseFlags []cli.Flag) error {
|
||||
for _, flag := range c.App.Flags {
|
||||
flagName := flag.Names()[0]
|
||||
|
||||
// the `len(baseFlags) > 0` check is needed because `c.IsSet(...)` is always false in unit tests
|
||||
if !c.IsSet(flagName) && len(baseFlags) > 0 {
|
||||
// the `c.App.Name != "test"` check is needed because `c.IsSet(...)` is always false in unit tests
|
||||
if !c.IsSet(flagName) && c.App.Name != "test" {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ func TestGeneratedFlags(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
app := cli.NewApp()
|
||||
app.Name = "test"
|
||||
app.Flags = append(app.Flags, generatedFlags...)
|
||||
|
||||
set := flag.NewFlagSet("test", 0)
|
||||
|
||||
Reference in New Issue
Block a user