mirror of
https://github.com/openziti/zrok.git
synced 2024-11-23 00:23:48 +01:00
31 lines
499 B
Go
31 lines
499 B
Go
package zrokdir
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
)
|
|
|
|
func configFile() (string, error) {
|
|
zrd, err := zrokDir()
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return filepath.Join(zrd, "config.json"), nil
|
|
}
|
|
|
|
func environmentFile() (string, error) {
|
|
zrd, err := zrokDir()
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return filepath.Join(zrd, "environment.json"), nil
|
|
}
|
|
|
|
func zrokDir() (string, error) {
|
|
home, err := os.UserHomeDir()
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return filepath.Join(home, ".zrok"), nil
|
|
}
|