mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-04 01:07:49 +02:00
cmd/ctrld: correct write default config condition when start
!76 was merged without rebasing on latest master, so it missed the condition of "--cd" when checking for writing default config.
This commit is contained in:
committed by
Cuong Manh Le
parent
8e91123dbf
commit
6edd42629e
+3
-1
@@ -162,7 +162,9 @@ func initCLI() {
|
|||||||
// WorkingDirectory is not supported on Windows.
|
// WorkingDirectory is not supported on Windows.
|
||||||
cfg.WorkingDirectory = dir
|
cfg.WorkingDirectory = dir
|
||||||
// No config path, generating config in HOME directory.
|
// No config path, generating config in HOME directory.
|
||||||
if configPath == "" && !isNoConfigStart(cmd) && configBase64 == "" {
|
noConfigStart := isNoConfigStart(cmd) && cdUID != ""
|
||||||
|
writeDefaultConfig := !noConfigStart && configBase64 == "" && cdUID == ""
|
||||||
|
if configPath == "" && writeDefaultConfig {
|
||||||
defaultConfigFile = filepath.Join(dir, defaultConfigFile)
|
defaultConfigFile = filepath.Join(dir, defaultConfigFile)
|
||||||
readConfigFile(true)
|
readConfigFile(true)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user