From 1e79ab78dd93c0cd12796c0333fc2455546408ad Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 11 Oct 2020 08:51:26 +1100 Subject: [PATCH] return default config when dealing with read only filesystem rather than create new config file --- pkg/config/app_config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/config/app_config.go b/pkg/config/app_config.go index df4707a94..b4671e047 100644 --- a/pkg/config/app_config.go +++ b/pkg/config/app_config.go @@ -4,6 +4,7 @@ import ( "io/ioutil" "os" "path/filepath" + "strings" "github.com/OpenPeeDeeP/xdg" yaml "github.com/jesseduffield/yaml" @@ -114,6 +115,9 @@ func loadUserConfig(configDir string, base *UserConfig) (*UserConfig, error) { if os.IsNotExist(err) { file, err := os.Create(fileName) if err != nil { + if strings.Contains(err.Error(), "read-only file system") { + return base, nil + } return nil, err } file.Close()