diff options
Diffstat (limited to 'config.go')
| -rw-r--r-- | config.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/config.go b/config.go new file mode 100644 index 0000000..4b253c9 --- /dev/null +++ b/config.go @@ -0,0 +1,16 @@ +package main + +import ( + "os" + "path/filepath" +) + +func GetIndexPath() string { + dataDir := os.Getenv("XDG_DATA_HOME") + if dataDir == "" { + home := os.Getenv("HOME") + dataDir = filepath.Join(home, ".local", "share") + } + indexPath := filepath.Join(dataDir, "autoindex", "index.html") + return indexPath +} |
