mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 00:21:04 +00:00
feat(config)!: Rename CONFIG_DIR env var to LAZYDOCKER_CONFIG_DIR
This commit is contained in:
parent
7e7aadc207
commit
bd16fbe63c
2 changed files with 14 additions and 1 deletions
|
|
@ -525,7 +525,7 @@ func NewAppConfig(name, version, commit, date string, buildSource string, debugg
|
||||||
}
|
}
|
||||||
|
|
||||||
func configDirForVendor(vendor string, projectName string) string {
|
func configDirForVendor(vendor string, projectName string) string {
|
||||||
envConfigDir := os.Getenv("CONFIG_DIR")
|
envConfigDir := os.Getenv("LAZYDOCKER_CONFIG_DIR")
|
||||||
if envConfigDir != "" {
|
if envConfigDir != "" {
|
||||||
return envConfigDir
|
return envConfigDir
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,19 @@ func TestDockerComposeCommandMultipleFiles(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestConfigDirUsesLazydockerConfigDir(t *testing.T) {
|
||||||
|
expected := t.TempDir()
|
||||||
|
legacy := t.TempDir()
|
||||||
|
|
||||||
|
t.Setenv("LAZYDOCKER_CONFIG_DIR", expected)
|
||||||
|
t.Setenv("CONFIG_DIR", legacy)
|
||||||
|
|
||||||
|
actual := configDir("lazydocker")
|
||||||
|
if actual != expected {
|
||||||
|
t.Fatalf("Expected %s but got %s", expected, actual)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestWritingToConfigFile(t *testing.T) {
|
func TestWritingToConfigFile(t *testing.T) {
|
||||||
// init the AppConfig
|
// init the AppConfig
|
||||||
emptyComposeFiles := []string{}
|
emptyComposeFiles := []string{}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue