used standart library instead of external
This commit is contained in:
		| @@ -45,7 +45,6 @@ air dev | ||||
|  | ||||
| - implementing proper command line args | ||||
|     - clear cache | ||||
| - use `os.UserConfigDir()` instead of the current library | ||||
| - implement fetching in intervals | ||||
|     - host this website on a demo page | ||||
| - implement ctl | ||||
|   | ||||
							
								
								
									
										1
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								go.mod
									
									
									
									
									
								
							| @@ -5,7 +5,6 @@ go 1.24.2 | ||||
| require github.com/labstack/echo/v4 v4.13.4 | ||||
|  | ||||
| require ( | ||||
| 	github.com/kirsle/configdir v0.0.0-20170128060238-e45d2f54772f // indirect | ||||
| 	github.com/labstack/gommon v0.4.2 // indirect | ||||
| 	github.com/mattn/go-colorable v0.1.14 // indirect | ||||
| 	github.com/mattn/go-isatty v0.0.20 // indirect | ||||
|   | ||||
| @@ -9,7 +9,6 @@ import ( | ||||
| 	"slices" | ||||
|  | ||||
| 	"gitea.elara.ws/Hazel/transfem-startpage/internal/diyhrt" | ||||
| 	"github.com/kirsle/configdir" | ||||
| 	"github.com/pelletier/go-toml" | ||||
| ) | ||||
|  | ||||
| @@ -103,11 +102,13 @@ func (c *Config) LoadDiyHrt(listings []diyhrt.Listing) { | ||||
| func (rc *Config) ScanForConfigFile(profile string) error { | ||||
| 	profileFile := profile + ".toml" | ||||
|  | ||||
| 	configPath := configdir.LocalConfig("startpage") | ||||
| 	configFile := filepath.Join(configPath, profileFile) | ||||
| 	baseDir, cacheDirErr := os.UserConfigDir() | ||||
| 	if cacheDirErr == nil { | ||||
| 		configFile := filepath.Join(baseDir, "startpage", profileFile) | ||||
|  | ||||
| 	if err := rc.LoadConfigFile(configFile); !errors.Is(err, os.ErrNotExist) { | ||||
| 		return err | ||||
| 		if err := rc.LoadConfigFile(configFile); !errors.Is(err, os.ErrNotExist) { | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if err := rc.LoadConfigFile(profileFile); !errors.Is(err, os.ErrNotExist) { | ||||
|   | ||||
| @@ -1 +1 @@ | ||||
| exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1 | ||||
| exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1 | ||||
		Reference in New Issue
	
	Block a user