History

Merge pull request #3292 from lihan3238/fix-3272

Luis Pater committed 6 months ago

Commit 68fddaa2 parents 09ac8a1 4cbe1722 files · +3 −1Browse files

Unified · Split

2 files
  1. internal/config/config.go +1 −0
  2. internal/util/util.go +2 −1
internal/config/config.go+1−0
@@ -22,6 +22,7 @@ import ( · 21 unmodified lines
2222 const (
2323 DefaultPanelGitHubRepository = "https://github.com/router-for-me/Cli-Proxy-API-Management-Center"
2424 DefaultPprofAddr = "127.0.0.1:8316"
25+ DefaultAuthDir = "~/.cli-proxy-api"
2526 )
2627
2728 // Config represents the application's configuration, loaded from a YAML file.
internal/util/util.go+2−1
@@ -73,9 +73,10 @@ func SetLogLevel(cfg *config.Config) { · 72 unmodified lines
7373
7474 // ResolveAuthDir normalizes the auth directory path for consistent reuse throughout the app.
7575 // It expands a leading tilde (~) to the user's home directory and returns a cleaned path.
76+// If authDir is empty, it defaults to ~/.cli-proxy-api.
7677 func ResolveAuthDir(authDir string) (string, error) {
7778 if authDir == "" {
78− return "", nil
79+ authDir = config.DefaultAuthDir
7980 }
8081 if strings.HasPrefix(authDir, "~") {
8182 home, err := os.UserHomeDir()

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t