mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-21 23:01:03 +00:00
Replace Project panel content with the project directory.
In the future, it may be worth trying to compute this from ComposeFiles.
This commit is contained in:
parent
8654d177d3
commit
86dfebdeaf
3 changed files with 13 additions and 3 deletions
7
main.go
7
main.go
|
|
@ -46,7 +46,12 @@ func main() {
|
|||
os.Exit(0)
|
||||
}
|
||||
|
||||
appConfig, err := config.NewAppConfig("lazydocker", version, commit, date, buildSource, debuggingFlag, composeFiles)
|
||||
projectDir, err := os.Getwd()
|
||||
if err != nil {
|
||||
log.Fatal(err.Error())
|
||||
}
|
||||
|
||||
appConfig, err := config.NewAppConfig("lazydocker", version, commit, date, buildSource, debuggingFlag, composeFiles, projectDir)
|
||||
if err != nil {
|
||||
log.Fatal(err.Error())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -362,10 +362,11 @@ type AppConfig struct {
|
|||
BuildSource string `long:"build-source" env:"BUILD_SOURCE" default:""`
|
||||
UserConfig *UserConfig
|
||||
ConfigDir string
|
||||
ProjectDir string
|
||||
}
|
||||
|
||||
// NewAppConfig makes a new app config
|
||||
func NewAppConfig(name, version, commit, date string, buildSource string, debuggingFlag bool, composeFiles []string) (*AppConfig, error) {
|
||||
func NewAppConfig(name, version, commit, date string, buildSource string, debuggingFlag bool, composeFiles []string, projectDir string) (*AppConfig, error) {
|
||||
configDir, err := findOrCreateConfigDir(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -390,6 +391,7 @@ func NewAppConfig(name, version, commit, date string, buildSource string, debugg
|
|||
BuildSource: buildSource,
|
||||
UserConfig: userConfig,
|
||||
ConfigDir: configDir,
|
||||
ProjectDir: projectDir,
|
||||
}
|
||||
|
||||
return appConfig, nil
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package gui
|
|||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
"github.com/fatih/color"
|
||||
|
|
@ -30,9 +31,11 @@ func (gui *Gui) getProjectContextTitles() []string {
|
|||
func (gui *Gui) refreshProject() error {
|
||||
v := gui.getProjectView()
|
||||
|
||||
dirName := path.Base(gui.Config.ProjectDir)
|
||||
|
||||
gui.g.Update(func(*gocui.Gui) error {
|
||||
v.Clear()
|
||||
fmt.Fprint(v, "lazydocker")
|
||||
fmt.Fprint(v, dirName)
|
||||
return nil
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue