Skip to content

Commit 9dc8a12

Browse files
committed
Use compose menu as env
Signed-off-by: Joana Hrotko <[email protected]>
1 parent f45a870 commit 9dc8a12

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Diff for: cmd/compose/compose.go

+2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ const (
6464
ComposeIgnoreOrphans = "COMPOSE_IGNORE_ORPHANS"
6565
// ComposeEnvFiles defines the env files to use if --env-file isn't used
6666
ComposeEnvFiles = "COMPOSE_ENV_FILES"
67+
// ComposeMenu defines if the navigation menu should be rendered. Can be also set via --navigation-menu
68+
ComposeMenu = "COMPOSE_MENU"
6769
)
6870

6971
// Command defines a compose CLI command as a func with args

Diff for: cmd/compose/up.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ type upOptions struct {
5555
wait bool
5656
waitTimeout int
5757
watch bool
58-
navigationBar bool
58+
navigationMenu bool
5959
}
6060

6161
func (opts upOptions) apply(project *types.Project, services []string) (*types.Project, error) {
@@ -128,7 +128,11 @@ func upCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service) *c
128128
flags.BoolVar(&up.wait, "wait", false, "Wait for services to be running|healthy. Implies detached mode.")
129129
flags.IntVar(&up.waitTimeout, "wait-timeout", 0, "Maximum duration to wait for the project to be running|healthy")
130130
flags.BoolVarP(&up.watch, "watch", "w", false, "Watch source code and rebuild/refresh containers when files are updated.")
131-
flags.BoolVar(&up.navigationBar, "navigation-menu", true, "While running in attach mode, enable shortcuts and shortcuts info bar.")
131+
composeMenu := true
132+
if os.Getenv(ComposeMenu) != "" {
133+
composeMenu = utils.StringToBool(os.Getenv(ComposeMenu))
134+
}
135+
flags.BoolVar(&up.navigationMenu, "navigation-menu", composeMenu, "While running in attach mode, enable shortcuts and shortcuts info bar.")
132136

133137
return upCmd
134138
}
@@ -262,7 +266,7 @@ func runUp(
262266
WaitTimeout: timeout,
263267
Watch: upOptions.watch,
264268
Services: services,
265-
NavigationBar: upOptions.navigationBar,
269+
NavigationBar: upOptions.navigationMenu,
266270
},
267271
})
268272
}

0 commit comments

Comments
 (0)