fix xdg-update-dir and enable prettypanic by default

This commit is contained in:
Nilesh Patra 2023-07-10 01:31:18 +05:30
parent 802d6afc55
commit 2b36ee3737

View File

@ -32,7 +32,7 @@ import (
) )
var writer io.Writer var writer io.Writer
var RecoverPrettyPanic bool var RecoverPrettyPanic bool = true
var DeadlockDetection bool var DeadlockDetection bool
var WriteLogs bool var WriteLogs bool
var OnRecover func() var OnRecover func()
@ -44,7 +44,7 @@ func GetUserDebugDir() string {
} }
// See https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html // See https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
if xdgStateHome := os.Getenv("XDG_STATE_HOME"); xdgStateHome != "" { if xdgStateHome := os.Getenv("XDG_STATE_HOME"); xdgStateHome != "" {
return xdgStateHome return filepath.Join(xdgStateHome, "gomuks")
} }
home := os.Getenv("HOME") home := os.Getenv("HOME")
if home == "" { if home == "" {
@ -67,7 +67,7 @@ func getUname() string {
func Initialize() { func Initialize() {
err := os.MkdirAll(LogDirectory, 0750) err := os.MkdirAll(LogDirectory, 0750)
if err != nil { if err != nil {
RecoverPrettyPanic = true RecoverPrettyPanic = false
DeadlockDetection = false DeadlockDetection = false
WriteLogs = false WriteLogs = false
return return