feat(pidproxy): read startsecs from env

chore: centralize env prefix
This commit is contained in:
2023-12-10 22:23:43 +11:00
parent 8704f80d4b
commit ad8499daa5
6 changed files with 19 additions and 10 deletions

View File

@@ -5,11 +5,11 @@ import (
"os/exec"
"time"
"gitea.suyono.dev/suyono/wingmate"
"github.com/spf13/viper"
)
const (
EnvPrefix = "WINGMATE"
EnvOneShotPath = "ONESHOT_PATH"
OneShotPath = "/usr/local/bin/wmoneshot"
)
@@ -20,7 +20,7 @@ func main() {
err error
t *time.Ticker
)
viper.SetEnvPrefix(EnvPrefix)
viper.SetEnvPrefix(wingmate.EnvPrefix)
viper.BindEnv(EnvOneShotPath)
viper.SetDefault(EnvOneShotPath, OneShotPath)