From f5f68e27dc648d392bcd2352f0448d58a62a3605 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 11 Mar 2020 15:58:40 +0100 Subject: [PATCH] use os.TempDir() for portable temporary directory --- pkg/flagset/flagset.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/flagset/flagset.go b/pkg/flagset/flagset.go index 8512b2d77c..7d97e9923b 100644 --- a/pkg/flagset/flagset.go +++ b/pkg/flagset/flagset.go @@ -1,6 +1,9 @@ package flagset import ( + "os" + "path" + "github.com/micro/cli/v2" "github.com/owncloud/ocis-thumbnails/pkg/config" ) @@ -136,7 +139,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "filesystemstorage-root", - Value: "/tmp/ocis-thumbnails/", + Value: path.Join(os.TempDir(), "ocis-thumbnails/"), Usage: "Root path of the filesystem storage directory", EnvVars: []string{"THUMBNAILS_FILESYSTEMSTORAGE_ROOT"}, Destination: &cfg.FileSystemStorage.RootDirectory,