add support for a global temp path

Fixes #436
This commit is contained in:
Nicola Murino
2021-05-27 15:38:27 +02:00
parent 7a85c66ee7
commit 3b46e6a6fb
14 changed files with 76 additions and 23 deletions

View File

@@ -52,7 +52,11 @@ func init() {
// NewGCSFs returns an GCSFs object that allows to interact with Google Cloud Storage
func NewGCSFs(connectionID, localTempDir, mountPath string, config GCSFsConfig) (Fs, error) {
if localTempDir == "" {
localTempDir = filepath.Clean(os.TempDir())
if tempPath != "" {
localTempDir = tempPath
} else {
localTempDir = filepath.Clean(os.TempDir())
}
}
var err error