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
22const (22const (
23 DefaultPanelGitHubRepository = "https://github.com/router-for-me/Cli-Proxy-API-Management-Center"23 DefaultPanelGitHubRepository = "https://github.com/router-for-me/Cli-Proxy-API-Management-Center"
24 DefaultPprofAddr = "127.0.0.1:8316"24 DefaultPprofAddr = "127.0.0.1:8316"
25 DefaultAuthDir = "~/.cli-proxy-api"
25)26)
26 27
27// Config represents the application's configuration, loaded from a YAML file.28// 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
73 73
74// ResolveAuthDir normalizes the auth directory path for consistent reuse throughout the app.74// ResolveAuthDir normalizes the auth directory path for consistent reuse throughout the app.
75// It expands a leading tilde (~) to the user's home directory and returns a cleaned path.75// 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.
76func ResolveAuthDir(authDir string) (string, error) {77func ResolveAuthDir(authDir string) (string, error) {
77 if authDir == "" {78 if authDir == "" {
78 return "", nil79 authDir = config.DefaultAuthDir
79 }80 }
80 if strings.HasPrefix(authDir, "~") {81 if strings.HasPrefix(authDir, "~") {
81 home, err := os.UserHomeDir()82 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