Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Add possibility to define cli download tmp path with env variable (#3298)

Trekky128056720e2345
diff --git a/cli/pkg/cli.go b/cli/pkg/cli.go
index cc9c399371..f6b4e11042 100644
--- a/cli/pkg/cli.go
+++ b/cli/pkg/cli.go
@@ -17,7 +17,7 @@ type ClICtrl struct {
}
func (c *ClICtrl) Init() error {
- tempPath := filepath.Join(os.TempDir(), "ente-download")
+ tempPath := filepath.Join(GetCLITempPath(), "ente-download")
// create temp folder if not exists
if _, err := os.Stat(tempPath); os.IsNotExist(err) {
err = os.Mkdir(tempPath, 0755)
@@ -34,3 +34,10 @@ func (c *ClICtrl) Init() error {
return nil
})
}
+
+func GetCLITempPath() (string) {
+ if os.Getenv("ENTE_CLI_TMP_PATH") != "" {
+ return os.Getenv("ENTE_CLI_TMP_PATH")
+ }
+ return os.TempDir()
+}