Refactor
This commit is contained in:
parent
33eb5e0bfc
commit
0aeb86cafb
1 changed files with 7 additions and 2 deletions
9
main.go
9
main.go
|
@ -12,15 +12,20 @@ type Config struct {
|
|||
Directories []string `yaml:"directories"`
|
||||
}
|
||||
|
||||
func main() {
|
||||
func getConfigPath() string {
|
||||
home, err := os.UserHomeDir()
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
configPath := filepath.Join(home, ".config", "git-repo-updater", "config.yaml")
|
||||
return filepath.Join(home, ".config", "git-repo-updater", "config.yaml")
|
||||
}
|
||||
|
||||
func main() {
|
||||
configPath := getConfigPath()
|
||||
data, err := os.ReadFile(configPath)
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue