Skip to content

Commit cace223

Browse files
temporary commit
1 parent 14b8431 commit cace223

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cli/cli.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,23 @@ func BaseCommand() *serpent.Command {
6161
config := Config{}
6262

6363
// Set default config path if file exists - serpent will load it automatically
64+
logToFile := func(message string) {
65+
if logFile, err := os.OpenFile("/tmp/yev_boundary_log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644); err == nil {
66+
fmt.Fprintf(logFile, "[%s] %s\n", time.Now().Format(time.RFC3339), message)
67+
logFile.Close()
68+
}
69+
}
70+
6471
if home, err := os.UserHomeDir(); err == nil {
6572
defaultPath := filepath.Join(home, ".config", "coder_boundary", "config.yaml")
6673
if _, err := os.Stat(defaultPath); err == nil {
6774
config.Config = serpent.YAMLConfigPath(defaultPath)
75+
logToFile(fmt.Sprintf("Config file loaded: %s", defaultPath))
76+
} else {
77+
logToFile(fmt.Sprintf("Config file not found: %s", defaultPath))
6878
}
79+
} else {
80+
logToFile("Failed to determine home directory, cannot check for default config")
6981
}
7082

7183
return &serpent.Command{

0 commit comments

Comments
 (0)