Join webbapp core modules into single package
This commit is contained in:
30
internal/webapp/defaults.go
Normal file
30
internal/webapp/defaults.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package webapp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
func DefaultConfigFileLocations() ([]string, error) {
|
||||
var locations []string
|
||||
|
||||
executablePath, err := os.Executable()
|
||||
|
||||
if err != nil {
|
||||
return locations, fmt.Errorf("unable to get my executable path: %w", err)
|
||||
}
|
||||
|
||||
configJSONPath := fmt.Sprintf("%s/data/config.json", filepath.Dir(executablePath))
|
||||
|
||||
locations = []string{
|
||||
"~/.aleesa-webapp-go.json",
|
||||
"~/aleesa-webapp-go.json",
|
||||
"/etc/aleesa-webapp-go.json",
|
||||
configJSONPath,
|
||||
}
|
||||
|
||||
return locations, nil
|
||||
}
|
||||
|
||||
/* vim: set ft=go noet ai ts=4 sw=4 sts=4: */
|
||||
Reference in New Issue
Block a user