globalConfigPath returns the path to the global config file. Checks $TASKMD_HOME_CONFIG first, then falls back to ~/.taskmd.yaml.
()
| 136 | // globalConfigPath returns the path to the global config file. |
| 137 | // Checks $TASKMD_HOME_CONFIG first, then falls back to ~/.taskmd.yaml. |
| 138 | func globalConfigPath() (string, error) { |
| 139 | if env := os.Getenv("TASKMD_HOME_CONFIG"); env != "" { |
| 140 | return expandTilde(env) |
| 141 | } |
| 142 | home, err := os.UserHomeDir() |
| 143 | if err != nil { |
| 144 | return "", fmt.Errorf("get home directory: %w", err) |
| 145 | } |
| 146 | return filepath.Join(home, ".taskmd.yaml"), nil |
| 147 | } |
| 148 | |
| 149 | // resolvePath expands tilde and makes relative paths absolute against baseDir. |
| 150 | func resolvePath(path, baseDir string) (string, error) { |